What are the limits of Python?

c++, python

Solution

Some Python limits :

- Python is slow. It can be improved in many ways (see other answers) but the bare bone cPython is 100 times slower that C/C++.

This problem is getter more and more mitigated. With Numpy, Pypy and asyncio, most performance problems are not covered, and only very specific use cases are a bottleneck in Python anymore.

- Python is opened to anything. It's really hard to protect / obfuscate / limit Python code.

- Python is not hype. Unlike Ruby, there is no "cool wave" around Python, and it's still much harder to find a experienced Python coder, than, let's say, a Java or a PHP pro.

- After using Python, a lot of languages seems to be a pain to use. You'd think it's good, but believe me, not always. When you have to go Javascript after a Python project, your eyes are in tears for at least 3 days. Really hard to get started.

- It's harder to find web hosting than for popular solutions, such as PHP.

- As a dynamic language, you don't have the very handy refactoring tools you could get with Java and Eclipse or C# and VS.

- For the same reason, you can't rely on type checking as a safety net. This is why pythonistas tend to follow best practice and write unit tests more often than others.

- It seems I just can't find an IDE with a decent code completion. PyDev, Gedit, Komodo, SPE, etc. just don't do it as good as it could be.

With Python 3 types hints and tools like PyCharm or Sublime Text+Anaconda, the situation has changed a lot.

- The best docs are still in English only. Some people don't deal well with it.

- You have to get use to the syntax. Not only you get spaces and line breaks instead of bracets, but you can forget about long lambdas, --i, and ternary operation.

Now, to me, these are not reasons to not learn a tool that will make you produce more while having more fun. But maybe it's just me :-)

Honestly, given that :

- C++ much harder to learn;

- You can do pretty much any thing you want with Python;

- You will get quicker result with Python in your projects.

Unless you have professional issues involving C++, you'd better learn Python first, it's more motivating. You still can learn C++ later, it's a useful language for system programming, embedded devices and such.

Don't try to learn both at the same times, multitasking rarely ends well.

Problem

I spent a few days reading about C++ and Python and I found that Python is so much simpler and easy to learn. So I wonder does it really worth spending time learning it? Or should I invest that time learning C++ instead? What can C++ do and Python can't ?

Original source