Live data from Hacker News

All the things I hate about Python

medium.com

11–20 of 87 posts

Re: All the things I hate about Python

#11
This starts off with a misunderstanding of what "strongly typed" means. Python is strongly, but dynamically typed.

Static typing means you know the type of something at compile time. Dynamic typing means you don't. The upside to dynamic typing is that the compiler doesn't have to prove much about your program; the downside is that it can't really prove much of interest either. Strong vs weak typing is about how much your language is willing to fudge types in order to make an operation succeed without errors -- be it the intended result or not. Both static and strong typing tend to make errors be more obvious sooner. Both dynamic and weak typing tend to require less boilerplate to make your program do things.

Python doesn't know the types of things in advance (dynamically typed), but it is very picky about which types are allowed to interact (strongly typed). Even in cases where the answer is obvious, like str.join, you still have to make everything strings: "".join([1, 2, 3]) will fail.

To demonstrate why these are orthogonal, consider the other cases.

Haskell is strongly and statically typed. A program that adds a string and a number together will be rejected at compile time because the compiler can prove it's invalid.

C is weakly and statically typed. A program that combines a string and a number may be accepted by the compiler, who interprets the number as, I dunno, a wchar_t or something. Another example of weak typing is how C allows (heck, encourages) pointer arithmetic and untagged unions/structs.

JavaScript is weakly and dynamically typed. A program that adds a string and a number together will, at runtime, convert the number to a string and then concatenate the two.

Re: All the things I hate about Python

#12
post #6

> Python is viewed as a ubiquitous programming language; however, its design limits its potential as a reliable and high performance systems language. Unfortunately, not every developer is aware of its limitations. Hammer is viewed as a ubiquitous [sic] tool; however, its design limits its potential as a reliable and high performance drill. Unfortunately, not every carpenter is aware of its limitations.

"Ubiquitous" is spelled correctly. Why the "[sic]"?

Re: All the things I hate about Python

#13
post #7

> Python is considered a weakly-typed or dynamically-typed programming language. This isn't right. Weak/strong typing is on a different axis than static/dynamic typing. Python is strongly typed. There's no implicit conversion among types (which is one marker of weak-typedness). For proof, consider: >>> 1 + '3' [...] TypeError: unsupported operand type(s) for +: 'int' and 'str' Strongly typed means that the types are…

It's also in the Wikipedia page about python that it is not a "weakly typed" language. It's literally in the resume box in the corner : "Typing discipline : Duck, dynamic, strong". Edit: I was going to mention the author's confusion, but OP did it in their edit. Edit 2: The author is "Staff Software Engineer at Tesla" ? And he doesn't know C pointers ?

It's worse than I thought. If you see my edit, I found that the author used their complete ignorance of the (strong/weak)/(static/dynamic) distinction to invent a claim of willful misdirection on the part of the Python community. Not only did they not do their homework on the topic, but they tried to portray people in a negative light to further their narrative. I find that incredibly dishonest.

Re: All the things I hate about Python

#14
post #6

> Python is viewed as a ubiquitous programming language; however, its design limits its potential as a reliable and high performance systems language. Unfortunately, not every developer is aware of its limitations. Hammer is viewed as a ubiquitous [sic] tool; however, its design limits its potential as a reliable and high performance drill. Unfortunately, not every carpenter is aware of its limitations.

"Ubiquitous" is spelled correctly. Why the "[sic]"?

From the context I think the author meant something like "useful for every task" rather than "commonly found everywhere" i.e. ubiquitous.

Re: All the things I hate about Python

#15

> Ok, so “hate” is a strong word, but hopefully this click-baits enough folks into reading this article with a clearer, more rational and unbiased demeanor than what the title suggests. Self-aware clickbait is the worst kind of clickbait.

What's even worse is the endless complaining about clickbait in legit and nicely informative posts.

Re: All the things I hate about Python

#16
The author complains about CPU-bound performance and then mentions PyPy but claims it's ecosystem is barren enough that the point stands. This claim is presented without evidence.

In practice it doesn't really show up: the cases where code is actually CPython-specific usually imply all the work is being done in highly optimized C bits. Hence, those programs, despite being run on CPython, aren't CPU-bound.

Finally: while this FUD is really pernicious because it used to be hard/impossible to get scientific code like numpy to run on PyPy, that hasn't been the case in a long time. Right now you can just pip install numpy and it'll just work.

Re: All the things I hate about Python

#17
The typing, encapsulation, and packaging issues are features of the language which have benefits and tradeoffs. The author of the article seems to balk at them because they aren't what he is used to. Re: typing in particular, gradual typing is something that's slowly becoming viable, and I think it's great.

The python 2 vs 3 issue isn't really an issue if you're starting with the language. There was a time where lots of big libraries were only supported by python 2, but that's definitely not the case any more.

OTOH the build system is definitely a common pain point, and the GIL forces you to use other services (e.g. redis + multiprocessing) to achieve horizontal scaling which is unfortunate. And of course python's crappy performance is something anyone looking at languages should be aware of.

Re: All the things I hate about Python

#18
post #9

> Ok, so “hate” is a strong word, but hopefully this click-baits enough folks into reading this article with a clearer, more rational and unbiased demeanor than what the title suggests. Self-aware clickbait is the worst kind of clickbait.

If the title had been "Python [is] a very problematic programming language for building reliable, high-performance distributed systems.", we'd all have just gone "duh" and moved on.

Yeah, but if that's the case then just have the title be clickbait and leave it. Having the title be clickbait and acknowledging that in the first sentence and trying to justify it as somehow improving the reception of the content is just kind of insulting.

"Look at me using the word hate misleadingly, hate is such a strong word". Is it though? This is like the title-writing version of /r/madlads. :-)

Re: All the things I hate about Python

#19

> Ok, so “hate” is a strong word, but hopefully this click-baits enough folks into reading this article with a clearer, more rational and unbiased demeanor than what the title suggests. Self-aware clickbait is the worst kind of clickbait.

All clickbait is self-aware. People aren’t not doing it by accident.

People can very well do it because they like fancy titles, or leaving things unspecified, or puns, or whatever, and not to drive visitors to their website.

In fact, before the web, authors have long used fancy titles for articles that you had to buy the magazine or newspaper to even read, so they had no advertising-like value to attract unsuspecting readers.

Re: All the things I hate about Python

#20

> Ok, so “hate” is a strong word, but hopefully this click-baits enough folks into reading this article with a clearer, more rational and unbiased demeanor than what the title suggests. Self-aware clickbait is the worst kind of clickbait.

All clickbait is self-aware. People aren’t not doing it by accident.

> People aren’t not doing it by accident

Were you self aware when using a double negative?

Post reply on HN