Live data from Hacker News

Why Python Is Terrible

josvisser.substack.com

41–50 of 125 posts

Re: Why Python Is Terrible

#41
> because the value of a good programming language is that it will not allow you to write programs that are structurally deficient.

Ummm... okay.

I'm not going to cheerlead for Python here (in fact I do not like it at all and also avoid it whenever possible) but many of this author's points seem to boil down down to "screwdrivers are bad, here's why you should always use hammers instead".

Different tools exist for different purposes.

Re: Why Python Is Terrible

#42
Python was already the most popular language for carbon-based intelligence, but now it's also becoming the one and only language for silicon-based intelligences.

The future is artificial intelligence programming Python and human programmers writing blog posts about how terrible Python is.

Re: Why Python Is Terrible

#43

I used to love python. It made me productive. Until it introduced the haphazard type system. Now I need to import types in every file, use IF to guard it in CI in every file, and use a powerful IDE to be able to use the benefits of typing.

> Now I need

You don't need to do anything, you can ignore all type hints

> use IF to guard it in CI in every file

Are you talking about "if TYPE_CHECKING:"?

Your other option is to put "from __future__ import annotations" at the top of the file, or wait for Python 3.13 when PEP 649 lands and type annotations become lazily evaluated.

Re: Why Python Is Terrible

#44
post #6

Yes, pretty much agree with this word for word. It is very, very difficult to refactor a python application in any sort of reliable way. The standard way of error handling in python appears to be to present the user with a stack trace. Very user friendly (not!). Now people will say that, for instance, mypy can help with this. That is true but since projects can be started without type checking chances are that your p…

I couldn’t (and still can’t) believe that non-exceptional situations are considered exceptional. Such as, there not being a way to parse a string into a number and return a value indicating if it was successful or not. With Python everything is an exception. Messy and inelegant. Of course this mess is called “pythonic” so everything is fine…

https://blog.codinghorror.com/exception-driven-development/a...

https://stackoverflow.com/questions/2184935/performance-cost...

Re: Why Python Is Terrible

#45
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 number for all variables that were created by the master process and inherited by the workers, and then not touching reference counts that had the magic value.

Thanks

Re: Why Python Is Terrible

#46
post #31
post #15

Earlier quoted context omitted.

Almost surely the author of TFA meant "dynamic", not lazy. Nobody uses "lazy" in the sense of TFA.

It’s just plain wrong. The Wikipedia link points to “lazy” in the Haskell sense. Python is not that.

Agreed. It's so evidently wrong my guess is that the author thinks "lazy" means "dynamic", searched Wikipedia and pasted a link to the article without reading it (in which case he would have found it didn't match his understanding).

It's the less insane explanation. The alternative, that the author read and understood what lazy evaluation is, but somehow still thinks Python does it this way, is too crazy to consider.

Re: Why Python Is Terrible

#48
post #11
post #4

Earlier quoted context omitted.

They probably mean dynamic.

It doesn't bode well when an article starts with such a gross misuse of a technical term. Far from me to defend Python, but this rant didn't start well.

Came here to make that exact comment. But I didn't see this comment, so I said the same thing.

Re: Why Python Is Terrible

#49
A few weeks ago I was working on a small wildfire smoke and fire perimeter API, and I hit a few annoying snags due to tooling issues. I needed to process a lot of different formats of layered geographic datasets, and converting one thing to another, processing the data into various buckets, cleaning, aggregating, etc. all wound up being extremely cumbersome and verbose.

I write a lot of Go and I’m used to that. But when I hit snags in the less familiar territory of geographic data processing, it was a slog. Terrible documentation for the libraries was a major barrier, and otherwise it seemed as though essential features simply didn’t exist and I’d have to invent them.

I got the idea to explore Python for the project because people use it for data processing. I’ve used it in the past, though never for this. Whatever, I thought, at the very least I can validate that Go is a suitable tool.

Within a day I had rebuilt everything with Python. I built a flask app around the forecasting and fire perimeter tools, and had it deployed the same evening. It was mind blowing.

As an ecosystem I was absolutely blown away by Python. Do I like the language? Not really. I encountered so many cases where something could be so much faster and more efficient with Go. Deployment would be easier. I’d get more API from the same resources. Scaling would be ten times easier. Static typing tools kept blowing up my IDE because this library doesn’t support this, or the type tool is wrong about that. It was very janky at times.

Yet Python got it done. It’s live right now, and development is steady. Go was not steady and I didn’t see any solution to that in sight without reinventing countless wheels.

Re: Why Python Is Terrible

#50
> I once worked with a service in Python that forked worker processes to handle requests, ensuring that all cores could be used.

> > Unfortunately these workers ran out of memory quickly so we decided to have workers terminate themselves after a configurable number of requests had been handled so that Linux would do our memory management for us.

I once worked with a service in Python that was essentially an image server for a special biomedical image format. The decoder was a proprietary C library written by a vendor and, unsurprisingly, had tons of memory leak issues. This exact feature of Gunicorn [0] saved us months of going back and forth with the vendor to get the library to stop killing our servers.

Python has it's flaws, but so does anything touched by humans.

[0] https://docs.gunicorn.org/en/stable/settings.html#max-reques...

Post reply on HN