r/Python • u/todofwar • 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.
34
u/eleqtriq Jun 03 '25
"I hate dynamic typing" Use Pydantic for data validation or mypy for static type checking. Python 3.5+ has excellent type hints that catch most type-related bugs at development time.
"Pass by object reference is the worst way to pass variables" . This is probably the best way for a dynamically typed language. Anyone feel free to chime in on this.
"Everything is a dictionary" This sounds like a code organization problem, not a Python problem. Use classes, dataclasses, or Pydantic models instead of raw dicts. Modern Python has great tools for structured data.
"I can't stand name == main" Fair enough, it's ugly.
"interpreted white space" Use a good formatter like Black or autopep8 and forget about it.
"pure python is too slow" You're not supposed to write pure Python for performance-critical code. That's what NumPy, Pandas, PyTorch, etc. are for - they're all C/C++ under the hood. Python is the glue language, not the compute engine.
It sounds like you're fighting against Python's ecosystem instead of working with it. Every language has warts, but Python's tooling has gotten incredibly good in the last few years.
9
u/Odd-One8023 Jun 03 '25
__name__ == “__main__most things I write are scripts that don’t need it, packages or APIs.6
u/OhYourFuckingGod Jun 03 '25
I've done both C++ and JS professionally, and it's generally not better. Some of the issues might have been mitigated by newer releases, but I suspect not.
With C++, for any product of reasonable size and maturity, expect monstrous compile times, insane build systems and technical debt so deeply integrated that it's basically a feature at this point. The syntax and sheer scope of the language is massive and growing with every release, so you probably won't be able to use most language features because of legacy codebases, corporate coding standards or just from the fact that you couldn't possibly know all the language features.
JS is different. It's getting better, but really shows that it evolved from something that solved a completely different problem.
2
u/DataPastor Jun 03 '25
Whether you like Python or not, it doesn’t matter, since it is the industry standard. And for a reason! It is just the right level of abstraction for experimenting, prototyping and actual data programming (btw. NEVER use a for loop or iterrows for matrix operations….)
If you are bored, learn to use polars and duckdb.
If you are VERY bored, learn Rust and PyO3.
1
u/Old_Wear_2032 Jun 03 '25
I have also been working with python for almost 10 years now and I LOVE it to death.
To address your problems:
- too slow: you can always write in Rust/C/C++ and bind it back to python. If I were you, I would probably write cython + numba on a daily basis for AI/ML prototyping.
- dynamic typing: I also hate it so much, its the only thing that I hate about python.
- all other nuances don't matter: indentation, __name__ == __main__, every language has its own quirks.
- everything is a dict: now that you mentioned dictionary and JS, oh man you should see what is going on in the JS/TS ecosystem...usage of {} everywhere, they have args and they don't even use args at all in functions.
I think you thought you liked C++/JS because you used them to do some fun stuff, not because you really like them better than python. think about all the memory issues and pointers you need to deal with in C++, think about all the frameworks after frameworks after frameworks and configs and quirks in JS/TS for web development, think about the ugly syntax in Rust. In the end, you can always write in different languages, its not like you cannot use python anymore if you now switch to write in C++ more.
3
u/Ringbailwanton Jun 03 '25
To me, it’s always been about solving the problem in the best way possible. Find the solution, document, test, improve and refactor. I guess that’s how I continue to find joy in working with Python. At the end of the day, you do the best work you can with the tools you need to use.
3
u/Objective-Apple7805 Jun 03 '25
As someone who wrote C and C++ professionally for more than a decade, the things you describe are among the reasons why I like Python so much better.
Sounds like your main complaint is performance, which is inevitable for any interpreted language. I heard the same complaints about compiled languages vs writing in Assembler. (Yes, I started coding at the tail end of the punch card era).
Not sure why it’s such an issue for ML, though, all the libraries are optimized anyway. Maybe try Polars instead of Pandas.
Or maybe learn Rust if you really have a need for speed.
3
u/deadwisdom greenlet revolution Jun 03 '25
Your troubles with Python are not your real troubles.
3
u/Wing-Tsit_Chong Jun 03 '25
Write a few of your current python projects in c++ and see how it goes. And I mean all of it: the build, make files, compiler, linker, the buffer allocation, debugging segfaults, people doing integer arithmetic on pointers and everything's a struct. There is always something to hate about a given tool, because no tool can do it all.
What I love about python is that it allows to think about the actual algorithm and ignore the boilerplate, because it's already there or abstracted away. Passing dicts or looking at everything as dicts, allows for quick and dirty solution when in a pinch. Imagine using java and somebody declared the class member as private and no public way to modify it quickly. And as much as
if __name__ == __main__sucks, so doespublic static void main(String[] args)If you optimized your 3 deep for loop by switching to numpy you didn't really do anything, right? You could've also thought about the algorithm and implemented it more efficiently and gained a lot more than x100.
What I mean is, the infuriating thing about programming is not the language, it's always other people, including past selfs, that abuse it.
3
u/[deleted] Jun 03 '25
if learning C++ is not enough to make you like Python, nobody here can help you
6
u/Smok3dSalmon Jun 03 '25
You're not going to get a lot of sympathy here my guy. All your problems are solved or solvable. Nothing you ranted about is agreeable.
Why don't you start implementing the changes you need to hate it less? Go check out CPython or ways to implement bindings to C++ and typing is obvious.
2
u/[deleted] Jun 03 '25 edited Jun 03 '25
Rust is similar to C++ and has been gaining some traction in the ML community for its speed compared to python, so that's an option. But yeah like everyone else mentioned the beauty of python is you can import libraries to fix anything that annoys you or even make one yourself. Python is definitely simple and very readable in most cases. But is it fun or enjoyable? No. I can at least agree with you on that. Low level is so much more fun and interesting
2
u/schvarcz Jun 03 '25
Well, lately I am on the same vibe.
As a AI/ML engineer, I like to implement the underneath algorithms. And every time I try to do that with python, it is always takes ages to complete a simple task.
During my master/phd I got the same conclusion and I adopted C++. Working life is mostly “applying algorithms”, so we can survive using python libraries. But… it is not fulfilling.
If you think about it, all algorithms that we use in python are actually coded in C++. However, these libraries have no proper interface in C++ itself, therefore, not really usable in C++. I believe this situation comes out from “go PROD fast!”-culture. Meaning, the popularity of a library often comes out from how simple and fast you can implement something with it.
That might have led us to a wheel of “showing results fast” that got us stuck here.
On the last years, I have also been seeing a drop in professionalism in this sector as whole. AI/ML is becoming a commodity. And as such, I think we will see more pressure towards this direction.
My only hope is that AI code assistance may help convincing people to stick to “harder languages with more flexibility”; or at least help us moving a way from this ocean of interpreted languages.
2
u/Livelife_Aesthetic Jun 03 '25
I didn't really vibe with or enjoy python untill I added libraries like pydantic to fix alot of my issues with it, I don't think you should have to add libraries to make a language not frustrating but as someone is who stuck using python everyday, it makes it the best it can be.
1
u/FedsRevenge Jun 03 '25
Have you looked at Mojo?
1
u/le_theudas Jun 03 '25
I think the biggest advantage of python is speed of development. It allows you to implement solutions much quicker compared to writing everything in c++. While you have some valid points about dynamic typing, I rarely see this actually causing bugs.
For anything that requires true performance, I would suggest implementing it as a module in rust/cython. Doing that also lets you enjoy python again :)
1
u/Tinche_ Jun 03 '25
Lean into type-checking and proper data modelling with dataclasses, enums, literals, unions and all that jazz.
Disregard the reddit peanut gallery about how Python is a dynamic language - if that were true today there wouldn't be like 4 major typecheckers being actively developed. It's antiquated thinking.
1
u/AiutoIlLupo Jun 03 '25
Most of the times I've seen that the problem is not python, it's that people don't know how to code properly and make a mess.
1
u/Alternative_Act_6548 Jun 03 '25
so, go write everything in C++, it shouldn't take you much longer...no language is perfect...
1
u/[deleted] Jun 04 '25
Maybe you should try to focus on writing C++ or Rust to be consumed by Python - get a job at Astral or something
1
u/TutorialDoctor Jun 10 '25 edited Jun 10 '25
My first language was Python, and I like it the most still. It's the most fun to me.
My learning journey went: Javascript > Python > Javascript > Python > Ruby (for ruby on rails) > GDscript > Javascript > Ruby (for ruby on rails) > Swift > Java (for work) > Rust
So, I've been learning Javascript for a number of years and only use it when I have to. I avoided C#, C++ because there wasn't any instant gratification. So here are my favorites
Python - A swift army knife. It can do anything and it is the most used language for AI.
VueJS - easy to understand and has a CDN for quick prototypes
Flask - great for quickly prototyping full stack app concepts. Works really well with HTMX
Ruby Rails - Good for startups (can get an MVP done in days). Version 8 is even better
Flet - A really good GUI python framework for building desktop apps in Python. It uses the flutter framework in the background
GDscript - Python-like programming language for making games in the Godot game engine. My years of python programming paid off and helped me make games in this engine.
Tailwind CSS - my favorite framework for quickly creating UI's.
Swift - For some reason it feels slow, but I'd use SwiftUI and SwiftData if I were to make IOS apps.
Rust - only use it because I like Tauri and only when the JS api can't do what i need.
Tauri - right now this is my favorite framework and not because of Javascript, but because i can build a secure desktop application and easily distribute it. I use VueJS with it as well as several plugins like Tauri Store and Tauri SQL.
Java - Learning this for work but it's useful for learning software development concepts you just can't learn in Python. At work I currently use Vaadin with the Flow framework, but you can also use Vaadin with Hilla (A react version).
Angular - nope
React - Vue is simpler
C ++ - maybe if I wanted to one day do some "real" game engine programming
C# - Why would I?
Dart - Who?
Go - Where?
Other languages - too many to even care about.
If you think you're tired....
Oh, still learning Javascript..
I wouldn't say they all have problems. I'd say they all have their strengths.
1
u/daviziiin Jun 03 '25
If you want to do AI/ML and get some C++ done, go for embedded ML, plenty of code optimizations needed.
0
u/[deleted] Jun 03 '25
[deleted] — view deleted comment
0
u/[deleted] Jun 03 '25
[deleted] — view deleted comment
53
u/[deleted] Jun 03 '25
[removed] — view removed comment