Why does Python get so much hate? It is literally like a Basic programming language. Easy to learn and guaranteed to get a job because of massive demand.
@nixCraft Hate on StackOverflow doesn't mean anything
@netbat @nixCraft This is the correct answer.
@nixCraft I like it due to its versatility, I write short scripts that have more...maintainability with it compared to shell scripts.
@nixCraft I think part of it is people just being weirded out by the white space thing, but it's such a perfect beginner language that's also a professional language.

@nixCraft that's why. Gatekeeping.

Though, I really don't like its approach to types.

@nixCraft significant whitespace makes it very easy to introduce invisible bugs and harder for people who need to customise whitespace for their own legibility (this applies to YAML, too)

And it seems that a significant portion of the industry has chosen static types for various benefits (with some downsides, too, of course) which isn't sufficiently supported by Python yet

@jokeyrhyme @nixCraft how could significant whitespace introduce invisible bugs? The entire point of it is that it’s easily visible.
Only way I can think of is mixing spaces and tabs in indentation in a way that on some editors will make a block appear to have the same indent but not be treated as such, but Python 3 already thought of that:

Indentation is rejected as inconsistent if a source file mixes tabs and spaces in a way that makes the meaning dependent on the worth of a tab in spaces; a TabError is raised in that case.

@nixCraft It's beautiful. 😍 Why would anyone hate it?
@nixCraft No, it is not like Basic. I need to exit insert mode to insert a line between lines and there is no (sensible) goto
 Two very Basic features! /j

(On a more serious note: I think the language is neat, sometimes a bit inconsistent, but for me the biggest issue might be that many parts of the ecosystem feel very chaotic and often not backwards compatible
 I enjoy the language, but can see why this might bother someone.)
@nixCraft I see a few reasons, one is I think there is a bit of gate keeping, just because its easy to learn I'm sure some people hate it. The white space and the syntax are other reasons I've heard.
@nixCraft it seems to have become the defacto AI language.. not that others can't, but python appears way more common

@nixCraft runtime errors, the GIL, non-static typing, formerly mediocre support for concurrency, bad package/environment management, mutable versus immutable data types, is versus ==

I actually love Python, but it does have some problems. Many of those problems have been mitigated or solved over the years though

@nixCraft I generally like Python. My main complaint, though, would be that it moves too fast. Old programs may stop working on new pythons, or you may want to run something and it requires a newer language version. There's too much churn in what's otherwise a great lanuage.
@nixCraft I think my only (main?) issue with Python is dependency management and that venv thing. Feels so so much like an after-thought.

@nixCraft I think one reason is gatekeeping, another reason is a sometimes deeply entrenched inability to see that different people have different needs, work with different constraints, etc.

So I like to remind people that: https://ciberlandia.pt/@villares/109885982178235703

Alexandre B A Villares 🐍 (@[email protected])

Attached: 1 image Friendly reminder: It's easy to forget there are many more people in the world that write code and are *not developers* than there are professional software developers. Scientists, journalists, lawyers, activists, med. doctors, writers, educators, artists, designers, and many others, can create computer programs! This paper from 2012 shows an 2005 estimate (for 2012) that there are almost 4x more people programming ("end user programmers") than professional programmers https://dl.acm.org/doi/10.1145/2212776.2212421 #EndUserProgramming #NotADeveloper

CiberlĂąndia
@nixCraft slow, single threaded, not strictly typed. dependency system is a bit janky and error prone.
@nixCraft I don't see it getting any hate. Quite the opposite. It's enormously popular. And not in the bad popular way that PHP has been for so long.
@nixCraft whitespace counts. I don't like languages like that.
@nixCraft

Python has become more and more pedantic. It started as a truly exceptional programmer's take on a language which would do what a competent programmer expected. It's evolved into demanding parentheses (print), pissing over tabs and spaces, and my favorite, will reject:

mysock.send("Hello, world.")

("You have to specify a codec.")

A committee of language lawyers and pedants keep pouring sh*t into it. I use the Tauthon fork of Python 2.7 whenever I can.

@vandys @nixCraft What about mysock.send(b'The data') ?

Personally I'm super grateful for the consistency introduced in Python3.

Sure, you might need a encode/decode more, but you don't have to guess what data type you're operating on anymore. Explicit rather than implicit is one of the core values after all.

#python

@nixCraft because Perl is superior, LOL
@nixCraft Indentation is frustrating, ambiguous unlike braces. Dynamic typing is dangerous and makes using somebody else's API needlessly complicated (what is this method expecting?). Haven't found an IDE anywhere near the equal of Eclipse. Biggest problem, it is very very slow. I find Java runs 10x faster. And versioning/environment/dependencies nightmares. Unfortunately, lots of scientific libraries are written in Python, so I'm stuck sometimes using it unless I can find an alternative.
@nixCraft Because it's easy to learn 😌
@nixCraft it’s too easy to learn. You don’t know Python until you realize you are bad at writing it, and there are a lot of people writing a lot of code who have not gotten to that point

@nixCraft Because it’s actually not that easy. It has a number of things that *seem* easy but are in fact quite complex for beginners.

It’s also a complete disaster in terms of dependency management, and has no coherent packaging and distribution story.

@curtosis @nixCraft
So true! They tried to fix dependency hell by making Anaconda and keeping 10 versions of python and all the libs at once, but now Anaconda itself sucks so much, that solving envo on a NFS share takes 30 mins.
Tbh CPAN sucked less. And it was notorious at being horrible.

@nixCraft Being a hobbiest and coming from C++ I had lots of issues with white spaces.

Being a long time Linux user I avoid Python apps due to them breaking when the distro inevitably no longer supports the version of Python they were written for.

@nixCraft Because of people using it as a replacement for the right tool for the job. It's easy to use and quick to make things with, but it's slow, dynamically typed and relied on white spaces. It's not bad, it's just the second best option for everything.
@nixCraft didn't take long for all the usual FUD to get rolled out in this thread.

@nixCraft The number of times I had some runtime error I couldn't figure out, so I added some debug prints, only to then get runtime errors on those prints, because I wrote int + string, which it obviously has no chance to resolve by itself, even if string * int is perfectly acceptable.
It is okay for small scripts, but debugging is painful.

Also, whatever the hell it does with optional non-scalar values.
def foo(bar = []):
bar.push(1)
print(bar)
foo()
foo()

@nixCraft The BASIC comparison is spot on. It’s a great language for education and for carrying out (relatively) small, well defined tasks. And yes, I’d include training LLMs in that scope.

It’s not great for building enterprise scale applications (dynamic typing, dreadful dependency management etc.), but that doesn’t mean it’s the wrong choice for everything.

@nixCraft Wait, does somebody hate Python?
@nixCraft white spaces 

@nixCraft “easy to learn” you say?! Count the number of different package managers and see if you can find a “standard” way of doing it. Imagine being a newbie and 5 (I wish it was five, but let’s pretend it is five) different people tell you about the “right” way of starting a project
 then we get to packaging/shipping your product and after all that you’re left with a piece of code that literally wastes energy and CPU cycles to do some task vvveeerrryyy ssslllooowwwlllyy


@nixCraft because it is just that: #BASIC if it was invented in the 2000s...

I've never needed to nor want to deal with it myself...