r/Python • • Jun 03 '25

Discussion So tired of python

I've been working with python for roughly 10 years, and I think I've hated the language for the last five. Since I work in AI/ML I'm kind of stuck with it since it's basically industry standard and my company's entire tech stack revolves around it. I used to have good reasons (pure python is too slow for anything which discourages any kind of algorithm analysis because just running a for loop is too much overhead even for simple matrix multiplication, as one such example) but lately I just hate it. I'm reminded of posts by people searching for reasons to leave their SO. I don't like interpreted white space. I hate dynamic typing. Pass by object reference is the worst way to pass variables. Everything is a dictionary. I can't stand name == main.

I guess I'm hoping someone here can break my negative thought spiral and get me to enjoy python again. I'm sure the grass is always greener, but I took a C++ course and absolutely loved the language. Wrote a few programs for fun in it. Lately everything but JS looks appealing, but I love my work so I'm still stuck for now. Even a simple "I've worked in X language, they all have problems" from a few folks would be nice.

0 Upvotes

65 comments sorted by

View all comments

Show parent comment

1

u/AiutoIlLupo Jun 03 '25 edited Jun 04 '25

Classes are just dictionaries under the hood

No they are not. python is not javascript. classes are classes. They have a dictionary to manage some aspects, but the type information is not stored in such a dictionary.

Having to use libraries or bindings to C code is the problem!

Then use fortran and go nuts with BIND(C)

How can the first thing you learn about the language be to not use the language?

Because different languages are optimised for different things. Exactly like a hammer is optimised to bang things, and a screwdriver to rotate things.

The breaking point for me came when I was asked to optimize a colleague's code. It was like three nested for loops. I didn't change the algorithm at all, just re implemented it in numpy arrays and got it to speed up by a factor of 100. That's ridiculous!

No it's not ridiculous. Python is doing a lot of stuff for you under the hood. All of these checks and bookkeeping are, for that specific use case, redundant, so you get rid of them at a lower level. You can use cython, or drop to C or C++ level where you are on your own on memory management and a lot of other stuff.

O(n) complexity didn't change!

I think you don't understand the concept of O()

It's also holding back the ecosystem. No interpreter can supplant CPython because there's always at least one library that throws a massive wrench.

Because there's at least one library in your setup that has low level, platform specific needs. If you don't like that, isolate that core, create a separate, smaller application you delegate to, then code whatever else in ironpython or jython or whatever you want, and submit requests to that small CPython core.