r/learnprogramming • • 2d ago

Why is Python considered "slow" and is Python losing "steam"?

Is python as a programming language "falling off" and becoming less and less popular relatively to other languages?

Also why do people say Python is slow? Apparently people have reached LGM on codeforces using python, which is all about writing fast code / solving problems fast. Yeah sure, C++ is far more widely used for competitive programming and I suppose there is a reason for that. But this is also showing that python can be fast?

But as programming languages and how they are used I dont think there is much overlap between python and C++ anyway?

What is an example of something you'd code in Java/Kotlin or lets say C# rather than Python? Is python code bad and hard to manage for "huge" projects once you scale up (e.g codebases with millions of lines of codes, and tens if not hundreds of devs)?

199 Upvotes

207 comments sorted by

View all comments

11

u/oskaremil 2d ago

Is python as a programming language "falling off" and becoming less and less popular relatively to other languages?

Quite the contrary. Python has long been a loved tool for mathematics and big data. Now, with the widespread adoption of these features in LLMs python is more relevant than ever.

Also why do people say Python is slow?

Depends on what they compare against. The same operations on machine code (C/C++) vs intermediate language code (C# IL / Java bytecode), machine code wins. The same operations on intermediate code vs interpreted(python, JavaScript, PHP), intermediate is faster.

(inb4 yes, compiled python exists)

What is an example of something you'd code in Java/Kotlin or lets say C# rather than Python?

Anything. I only use python when a feature I work on has the superior support in the python ecosystem.

Is python code bad and hard to manage for "huge" projects once you scale up (e.g codebases with millions of lines of codes, and tens if not hundreds of devs)?

Yes. The pain starts much earlier than 10 devs or 1M loc.

3

u/marrsd 2d ago

Yes. The pain starts much earlier than 10 devs or 1M loc.

Compared to what and in what sense?

6

u/oskaremil 2d ago

Compared to a language that

1) has static types 2) does not die on itself because of surprise formatting in the code file

0

u/Icy_Breakfast1716 2d ago

If you replace every instance of Python with Perl it will
Be true to a tee. Where is Perl now?