Live data from Hacker News

All the things I hate about Python

medium.com

61–70 of 87 posts

Re: All the things I hate about Python

#61
Hi everyone, so I'm the guy who wrote this article. I'm sharing a video recording of George Hotz writing some Python code. Note his reaction at 5:55

https://www.youtube.com/watch?v=7Hlb8YX2-W8&t=355s

His outburst is an emotional manifestation of the different sources of frustration I've had working with Python that I've tried to document.

A common theme I've seen in responses is that many claim that I've mistaken Python as a weakly-typed language countering that it is indeed a strongly-typed language -- obviously an argument of semantics. I'll define a "strongly-typed" language as one where it is trivial to identify the type signature and definition of any function or variable in a program. In Python, this is non-trivial.

FYI, this article is also cross-posted on:

https://news.ycombinator.com/item?id=16337435

https://news.ycombinator.com/item?id=16371338

https://news.ycombinator.com/item?id=16411765

Re: All the things I hate about Python

#62
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]"?

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

For what it's worth, '[sic]' doesn't necessarily mean "that was spelled incorrectly", only, literally, "thus": i.e., "that's the way it was in the original; don't blame me." As such, it can be used to indicate misspellings or 'misconceptualisations' ("I know that it's the wrong word, but it's the one that was there"), as nmyk (https://news.ycombinator.com/item?id=17484468) indicates.

Re: All the things I hate about Python

#64
post #52

Earlier quoted context omitted.

It will bite you when you don't expect it. When i work, we had a dev write a IO trace playback engine in Python to do some IO performance testing. We then deployed it on various platforms and got very strange results - eventually I noticed when TOPing the node, the CPU was pegged at 100%, so this wasted about 2 months time of about ~4 developers

What was the root cause?

Wasn't worth taking the time to figure out, since none of us were expert level in python and we only needed a one-off profiling tool. I rewrote it in Julia, which killed the problem.

Re: All the things I hate about Python

#65

Hi everyone, so I'm the guy who wrote this article. I'm sharing a video recording of George Hotz writing some Python code. Note his reaction at 5:55 https://www.youtube.com/watch?v=7Hlb8YX2-W8&t=355s His outburst is an emotional manifestation of the different sources of frustration I've had working with Python that I've tried to document. A common theme I've seen in responses is that many claim that I've mistaken Pyt…

Wow, I had the same error as Hotz's last night, it crashed the program after about 15 min of calculations, which then had to be rerun. I couldn't even blame myself, because that was someone else's code.

Re: All the things I hate about Python

#66

after 5-6 languages and coming back to Python I would say the worst things are - large and inconsistent stdlib api, - extremely wordy but somehow still vague documentation - overwrought build/packaging system (although tooling has improved) - endless runtime gotchya debugging in production - almost all the baggage of OO boilerplate but none of the benefits of type-checking. - half-baked functional paradigms

Great list!! Captures my thoughts and complaints perfectly after coming back to python following a few months in typescript land.

Although I would add the incredibly slow process start time to the list as well.

Re: All the things I hate about Python

#67
post #52

Earlier quoted context omitted.

What was the root cause?

Wasn't worth taking the time to figure out, since none of us were expert level in python and we only needed a one-off profiling tool. I rewrote it in Julia, which killed the problem.

So you have no idea what it was but you’re certain it’s Python’s fault?!

Re: All the things I hate about Python

#68
I teach intro programming using python, and use it regularly for various projects.

But I agree with the author's central point that the language has a number of issues.

He mentions the python2 vs python3 issues, but doesn't discuss what is to me the biggest problem of all that: there is no standard simple way to identify within the code what version of python it needs or is written for. Coming originally from the perl world, that has always seemed like a significant oversight.

Nor does he mention several of my other biggest issues with the language, such as the arbitrary assignment of some operations to global functions (i.e. a=[3,2,1]; len(a)) while others are method calls (i.e. a.reverse()) which return nothing. And then there's list(reversed(a)) and all the iterator awkwardness ...

Explaining to students learning programming for the first time why neither of these do what they expect is never fun.

    >>> print(a.reverse())
    >>> print(reversed(a))

Re: All the things I hate about Python

#69

One thing not mentioned by anyone yet, that kinda annoys me is the fact that Python libraries use different naming conventions. Even though PEP 8 has existed for 17 years now, there are many examples where I see lower_case_with_underscores mixed with lowercase and camelCase in the function names. I know that many libraries and Python standard lib itself predate this PEP but I don't understand why Python 3, which brok…

Oh yes! Or at the very least created aliases with the correct casing.

Re: All the things I hate about Python

#70

I teach intro programming using python, and use it regularly for various projects. But I agree with the author's central point that the language has a number of issues. He mentions the python2 vs python3 issues, but doesn't discuss what is to me the biggest problem of all that: there is no standard simple way to identify within the code what version of python it needs or is written for. Coming originally from the per…

Yes, much of what's wrong with python in one line of code: >>> reversed(a)

who needs a __str__ method for listreverseiterator anyways. they cherrypicked the worst of the Java world: Unreadable names and batteries excluded. yuck!

Post reply on HN