DEV Community

loading...
Cover image for Areas where Python is not recommended

Areas where Python is not recommended

yadunandanbhat profile image Yadunandan Bhat ・2 min read

Python might be the most popular programming language in the world, but that doesn't mean it can be used everywhere. I've listed some fields where using Python is not recommended.

Systems programming

This is because Python is very, very slow compared to something like C/C++, just because it is an interpreted language. These languages are processed at runtime. Every line is read, analyzed, and executed. This makes the interpreted code run 5 - 10 times slower than compiled code. Even JIT-compiled languages like Java can beat Python in terms of speed. This isn't to say that you can't write device drivers with Python and then use C or assembly language layer to communicate with hardware, but this route isn't generally used.

Mobile app development

While it serves as an excellent server-side language, Python is rarely seen on the client-side. Besides that, it is rarely ever used to develop mobile applications. Neither Android nor iOS support Python as an official programming language.

It is still possible to develop mobile applications in Python using Kivy, but it requires more time and effort on the part of the developer to deliver a rich user experience. That is why Kotlin and Swift are some of the preferred languages when it comes to mobile app development. And Java is commonly used for banking web applications due to its particular strength in security functionality and environment. Java includes access to certain security features such as cryptography, and advanced authentication and access control that keep your web application secure.

Game development

PyGame or Tkinter libraries are a good choice for beginners learning how to make simple games. But, the performance of Python isn't good enough for the resource-intensive parts of the game engine for higher-end games. Therefore for more resource-intensive games, developers consider the industry standard which is C# with Unity or C++ with Unreal. And most people getting into game development are looking for a robust platform that offers plenty of scalabilities. Unity and Unreal offer exactly that, and you need to know C# or C++ to use them. However, Python is used as a scripting language in some game engines.

Embedded Systems

Python needs more resource overhead and is also a lot slower. Especially in embedded devices, you can't have luxury like an automatic garbage collector. Once a program is written in C/C++, it can be converted into bytecode/instructions for a particular embedded platform and uploaded onto it, but you can't do that in Python as it is an interpreted language. C can also utilize the hardware to its maximum by multiprocessing and multithreading APIs provided by POSIX, but Python can't work like that because it has GIL.

If you find any errors, please feel free to comment down below!

Discussion

pic
Editor guide
Collapse
feichinger profile image
FJones

Definitely true for app and game development, not entirely true for systems and embedded programming. Python is not the best tool for the job in these context, obviously - a bytecode executable is always going to outperform Python.

But: Embedded has many aspects. Microcontrollers are becoming more powerful every day, and Python enables easy interfacing with the system without the labour overhead of a language like C. Similarly, in systems development, using Python to interface with standard functionality is actually fairly common - think of a lot of low-level sh scripts. Many of these are easily replaced by a more powerful Python script. Networking code in particular is also a common application for Python in spite of performance drawbacks.

It depends a lot on concrete use cases and the goals. Ultimately, much of this post boils down to "Python is slower than C" - which, while true, drops a lot of the other goals one might want to achieve in these contexts.

Collapse
saymy__name__ profile image
Jordan Engstrom

You can make a binary executable with pyinstaller if you want python bytecode.

Collapse
yadunandanbhat profile image
Yadunandan Bhat Author

Thank you so much for the insight! I didn't know these things!

Yes I centered the whole post around "Python is slower than many languages out there"! 😅

Collapse
stokry profile image
Stokry

Totally agree with you!

Collapse
yadunandanbhat profile image
Yadunandan Bhat Author

Thank you very much!!!!

Collapse
bushboy profile image
Bush-boy

I wouldnt know about, that but am learning js now, maybe you could assist me with the best areas that i should focus on, am told webdev is one strength of js any other areas???

Collapse
yadunandanbhat profile image
Yadunandan Bhat Author

You can use nodejs for server side, electron for desktop app development, react native for cross platform app development, react and angular can be used on frontend, and there's a language called dart, which is like a mixture of java and js, and that can also be used in flutter app development

Collapse
bushboy profile image
Bush-boy

thanks, seems theres alot to learn.....