r/AskComputerScience • • Nov 27 '22

Is python being slow really an issue in the industry?

I know it is the slowest language but is it really an issue that other languages should be learn, if so what do you suggest C# or Java? can I just understand C# without going to C/C++?

35 Upvotes

14 comments sorted by

4

u/xiongchiamiov Nov 27 '22

Let's step back: what are you trying to learn?

1

u/Sake99 Nov 28 '22

I switched careers and did a MS in computer science with python as main language. I'm looking forward to enter career in software engineering or specifically DeveOps Engineer.

1

u/xiongchiamiov Nov 29 '22

If you got your master's then hopefully you already have a solid base of programming skill.

Python, which you already know, is a perfectly valid choice for a software engineering career (as would also be java or c# if you had learned them instead). In particular it is common and useful in devops positions.

34

u/rgnkn Nov 27 '22

Different languages for different use cases!

Whether Python is (too) slow depends on the expectations, the domain and (potentially) the algorithms and modules you're using.

So, what are you planning to program?

If it's an operating system you want to program most of the languages you mentioned are at least problematic (except C/C++).

If it's for automation purposes Python could be the / a ideal solution.

...

BTW:

Effectively, if I need a tool tomorrow the Python solution might be the only possible if development in C++ takes 3 days even if the C++ implementation is 100s of times more performant than the Python implementation.

18

u/BlobbyMcBlobber Nov 27 '22

Absolutely not. The trick isn't to avoid python because of speed, but to choose the right tool for the job.

Every language has its use case. Python might not be suitable for real time systems programming, and it will never be as fast as a compiled language. But it has plenty of use in data science, web apps, instrumentation and it has much higher portability.

Python is actually growing in popularity since the move to 3. It has a huge amount of very useful and friendly libraries. It's definitely being heavily used in the industry.

2

u/dcfan105 Nov 28 '22

Python might not be suitable for real time systems programming, and it will never be as fast as a compiled language.

Aren't there compiled implementions of Python though? The standard implementation, CPython, certainly isn't a compiler, but, IIRC, the PyPy implementation uses a bootstrapped JIT compiler and is orders of magnitude faster than CPython. The downside is that I believe it doesn't support all the libraries written in C, like numpy and scipy, which means it's not suitable for work in data science or statistics.

1

u/Sandarr95 Nov 28 '22

Every language has its use case.

Except Malbolge. But yeah, the exception proves the rule.

9

u/victotronics Nov 27 '22

All the big python libraries in computational bio & big data are really written in C++, so python is only the user interface layer. To me taht's a perfect way to use python to make complicated software friendly to use.

4

u/[deleted] Nov 27 '22

Depends on the specific needs of the “industry”. This probably actually is a factor in why Python isn’t used to write triple A games, for example.

6

u/thegreatunclean Nov 27 '22

You wouldn't write a high-performance rendering engine in a scripting language but you would absolutely use one to implement a merchant or quest system. It is super common for game engines to have an embedded scripting language to make content creation / editing easier.

1

u/jmhimara Nov 28 '22

As everyone has already said, it depends on the application. I'm often wary of "slow" languages because I have seen many examples of people underestimating the slowness of python and end up rewriting a lot of code. But that's just lack of awareness. As long as you know what you're doing, it should be fine.

However, I'd say that the biggest issue with python is not its speed but the typing system. The flexibility of Python means it is great for prototyping, scripting, automating small tasks, etc., but large projects become hard to manage.

1

u/Sake99 Nov 28 '22

what do you mean by 'large'? for example, is it bad if someone codes facebook in python?