Live data from Hacker News

Why Python Is Terrible

josvisser.substack.com

71–80 of 125 posts

Re: Why Python Is Terrible

#71
post #18

My experience with Python can be summed up as: it's tempting to start something with it, since it has such low (initial) friction and hey, "this is just a small throwaway project anyway". Months or years later, it's a beast, hard to understand or refactor, full of holes and pitfalls, and Python's terrible tooling doesn't help either. And I never learn the lesson!

What tooling are you missing?

I've been down this road before on HN, so let's agree I don't find the existing tooling satisfying at all.

The linter is ok, and an occasional lifesaver (but it shouldn't even be needed! It requires extra work to catch problems that other languages catch "for free"). And it shouldn't be a separate tool. It's also cumbersome to use, silence what is not needed (way too noisy) and fine-tune it. Inline comments to enable/disable it for specific warnings look ugly, too. Python devs tend to suppress whatever bothers them instead of fixing it because it's not in their culture.

The type hinting checking is terrible. It's getting better, but it still misses obvious things and requires too much hand-holding. In my experience, average Python devs don't use it because they don't understand it, or don't find the ROI worthwhile. And because it's optional, they can just pretend it doesn't exist (or complain if you make it mandatory).

The mess that is dependency management has been discussed multiple times. In Python's defense, it's in "good" company with other messes from different languages. But Python's case seems particularly horrifying.

In general, with tooling, Python lives in a special hell where every blog and article will tell you "it's awful because you're doing it wrong, you should instead [use|avoid] pip, pyenv, pipenv, poetry, , , ".

Re: Why Python Is Terrible

#72
post #12

> And, not to put too fine a point on it, but if you can code Python but not Go (or another decent programming language), you probably have no business writing software for a living. I know it sounds harsh and I apologize for that, but writing software is a profession and hence you should have the knowledge, skill, and experience to use professional tools. Part of the profession of software engineering is maintaining…

Let me ask the obvious question. Why hasn’t the go community, of professional software engineers built an even richer ecosystem of libraries? Is it ennui, incompetence, or attitude? As Go came from Google, is that the attitude was, “I am a professional I’ll just write my own code to solve X”, rather than considering building a library that others can use? Are libraries harder to build in Go? Is adoption of libraries…

Yes. Go has a culture that avoids using libraries (the axiom is "a little copying is better than a little dependency" (see, e.g. https://www.efekarakus.com/2021/09/23/a-little-copying-is-be...)

Re: Why Python Is Terrible

#73
post #12

> And, not to put too fine a point on it, but if you can code Python but not Go (or another decent programming language), you probably have no business writing software for a living. I know it sounds harsh and I apologize for that, but writing software is a profession and hence you should have the knowledge, skill, and experience to use professional tools. Part of the profession of software engineering is maintaining…

Let me ask the obvious question. Why hasn’t the go community, of professional software engineers built an even richer ecosystem of libraries? Is it ennui, incompetence, or attitude? As Go came from Google, is that the attitude was, “I am a professional I’ll just write my own code to solve X”, rather than considering building a library that others can use? Are libraries harder to build in Go? Is adoption of libraries…

Why do people use Microsoft Windows on x86?

The computer industry has a bizarre reputation for moving fast and breaking things. In fact the industry is shockingly conservative. You will encounter many, many programmers who flat-out refuse to learn new things.

Re: Why Python Is Terrible

#74
post #3

Terrible is using a dynamic programming language and expecting static features from it. Besides, linters and type hinting have come a long way.

>Besides, linters and type hinting have come a long way.

You acknowledge that the kinds of static analysis that are feasible in Python are valuable, but it's "terrible" to want the kinds of static analysis that are infeasible. How interesting that the two boundaries line up exactly.

Re: Why Python Is Terrible

#75
It's almost like curly braces make for better languages :-P

My problem with python is its package system, and the mess around the fact it was designed to be global. (I have a similar gripe with Ruby).

Re: Why Python Is Terrible

#76

Can someone explain this part to me, please? I don't follow what's going on. > Python's use of reference counting defeated copy-on-write because even memory blocks holding variables that were read-only were actually written to in order to manipulate the reference counts, thereby blowing up the combined physical memory footprint of the workers. We solved this by smurfing the interpreter to use a magic reference count…

I don't understand the "smurfing" solution he references, but CPython's runtime uses reference counts in each referenced value to detect garbage (when a value can be freed), which means even read-only values can be modified in memory by the runtime as object references come and go.

Those modifications force pages which were created on forking a child process as copy-on-write (meaning they share the same physical page until the page is modified by the child) to be copied and thus blow out any memory savings that would normally happen with copy-on-write.

Re: Why Python Is Terrible

#77
post #57

Earlier quoted context omitted.

> with lazy evaluation I know it has functions that are lazy, but it's not lazy as in a sense that Haskell is right? I never use it as I find it a ghastly horror show (my taste, other people like it, that's fine), but I had to use it a few times and found that (also from the article) some parts are lazy, but not python as a language. Is that not correct? > it does limit the sorts of problems the language is suited fo…

Not Haskell style lazy but more of declarations are just another statement that aren't evaluated until those lines are executed. This means you can have function definitions inside of ifs which can be very useful for conditional programming / meta programming. Similarly, all variable accesses happen at runtime. This makes it so you can't truly statically verify the program but that the only way to know for sure how i…

What you describe is not lazy evaluation in any accepted sense of the term. I bet you it's also not what the author meant; he was probably thinking of dynamic typing.

Alternatively, maybe the author (and you) meant "interpreted language"? Lazy/strict evaluation is an orthogonal aspect.

Re: Why Python Is Terrible

#78
post #53
post #29

Earlier quoted context omitted.

Aha, you pointed out the disease. This is the biggest problem in software and it's kind of intractable. The ideal world has tools that empower everyone to do what they need to do, which to some extent must include an activity like programming. But, and this may be unconscious, "people who program for a living" have a strong incentive to gatekeep.

What's amazing is people who program for a living, who people would normally think of as being "experts", have so little knowledge of all the different types of programming that is done by, well, people who program for a living, and the tools they use to do that programming. Not only then is it gatekeeping, it's also a sign of an inexperienced programmer. I'll give one thing to Python programmers, they tend to work d…

You're saying that specialization is bad and that specialists can't be experts.

Re: Why Python Is Terrible

#79

Earlier quoted context omitted.

> with lazy evaluation I know it has functions that are lazy, but it's not lazy as in a sense that Haskell is right? I never use it as I find it a ghastly horror show (my taste, other people like it, that's fine), but I had to use it a few times and found that (also from the article) some parts are lazy, but not python as a language. Is that not correct? > it does limit the sorts of problems the language is suited fo…

You are right, the article is wrong. It is most certainly not lazy. f(g(), h()) will always call both h and g regardless of whether f uses their results. Iteration in a sense can be "lazy", but that laziness is via data structures built on top of a strict core language. Python is not alone in having lazy iteratable data structures, but it leans into them relatively hard in its standard library. Many of us love this,…

Almost every mainstream language has a way to "lazily" (in the sense you mean) iterate over lists, so this can't be what the author was singling out. I think he's just confused.

Re: Why Python Is Terrible

#80
post #26

Every single "This language is good" or "This language is bad" take really needs to always come with a "for what, exactly." "This wrench is really bad for hammering nails!"

Agreed. But I also think it's fair to criticize general purpose languages on general grounds :)

It's just that this article isn't very good at it.

Post reply on HN