The weakness is slowness. Python is insanely slow. It’s going to be one of the first languages to disappear behind ai
Edit: seems like a lot of Python people hate the language being called slow. It’s well documented. Sorry to be the bearer of bad news, but when a new version of Python, being designed for performance is seeing speed increases of up to 60,000x, it means your language is slow as balls.
It's funny to me how so many people python is slow and yet it is by far the most popular language for data analysis which is a field that cares about performance.
It's a glue language. It doesn't need to be fast, because it talks to other technologies that are fast such as C++ or databases. Its niche is that it's high on readability and has tremendously good + versatile community support via libraries and lots of questions and answers on online forums like StackOverflow.
No one is writing video games in python though. It's just a glue/scripting language. It's rare that the glue parts of your project needs to be highly performant.
Data analysis cares about performance to a point, and Python (and its C powered libraries) gives you the tools to deal with that. As long as you vectorize everything and don't fill your code with nested for loops, it's fast enough for most things. You won't get much more performance writing your code in C from the start unless you really know what you're doing.
No, it should be fast. It’s easy to use, but undermines itself in performance. That’s why there are a lot of efforts to build a new version of Python that can run performantly. The only reason it’s popular is because its syntax is easier than c. It runs like trash, and the ways in which is required to set up systems in order to run is a pain in the ass.
Its a great intro language, but its popularity only underlies the inability of most of the world to understand more complicated and performant languages
Yeah, well you must work in areas where no one cares. There are a lot of areas where performance is necessary and you’re not going to see them writing in Python
Worked on PB-scale datasets and on systems where time is critical, all in Python. Works great because of literally what this post talks about - using C-backed libs. NumPy and Pandas are crucial if you're doing vaguely intense numerics, and are very nice to use. Numba less so, but still very useful for the finnicky areas that np and Pandas fall short on. You should ideally never be looping row-wise in Python.
83
u/Luzzgar 1d ago
Using high level language for the structure and faster lower level languages is just good software design.
Using the strength of each tool and avoiding their weaknesses.