When Python Faces the music

When Python Faces the music

βoγ Woηdεr (@Nanakill27) ‌

Python’s Drawbacks and Why Python maybe not be the Best way to start your Programming Journey


DISCLAIMER 

First, I would like to say that I don't really have anything against python so what I write after this are of my personal thoughts backed with hours of reading and from my personal experience on participating in debates on this topic. The scope of this blog focuses on Python and python itself only NOT on its libraries and frameworks.


The Vice Behind All the Shining Gold

  As We all know Python is one of the most growing and most well know languages out there. But should we really consider it for beginners? And what are its drawbacks? These are the questions I will be answering today. 

Python is a good language probably the easiest and most syntax-readable language out there I could open a c++ project and wonder all day long and not understand a thing but I could literally understand a complex python project right off the bat after trying out python for a month or so. but that isn’t the question we need to ask ourselves. The real question we should be asking here is at what happens when python faces the music? At what price are we getting these amazing features? And are they worth it?


 Scalability (A flaw not necessarily a reason not to begin learning)  

 The first reason and one of the most decisive drawbacks of python which makes it challenging to use in a very large-scale production environment is that python doesn’t scale that well. What I mean by Scale in this context "programming in the large" i.e. can large teams of software engineers use Python to create large pieces of software? The main issues I have found are Slow Speed of Execution, Weak Multi-threading and Dynamic typing. 


Slow Speed of Execution

 Python is slow which might be an issue depending on your project and what you're using it for. The main reason behind its unimpressive speed is because python is an interpreted language. All interpreted languages suffer this because they have to run a space-wasting interpreter, and can’t be optimized to do multi-threading well. People need to understand the difference between interpreted and compiled.

  Interpreted languages like Python are just plain text and have to be interpreted at run time. Each line of the script may require hundreds or even thousands of programming instructions to execute, in a dual-stack, recursive descent parsing algorithm. That is a speed loss of 100 to 1000 or so. But a real programming language like C/C++ can be another 10 times faster than that, because the ahead of time compiler for C/C++ can spend a great deal of time finding ways to optimize the whole program together, where many lines can be removed, and others shifted around. So in some worst-case scenarios, Python could be over 10,000 times slower than a precompiled language like C/C++.


Weak Multi-threading

 Python has a weak multi-threading system as mentioned above its scripting nature is one reason but the other issue with python’s multi-threading is concurrency. Which is the cause of Global Interpreter Lock(GIL) which prevents multiple threads from executing Python bytecodes at once. This prevents multi-threaded programs from taking full advantage of multiprocessor systems in certain situations. Which makes python programs power-hungry when used on a bigger scale with multi-threading. 


Dynamic typing

 But let's forget speed Python's use of dynamic types, for me, is a bigger problem when you start talking about scaling in terms of the number of developers on a project. Even though dynamic typing saves time on writing code when you're developing a big project having Type Check is REALLY REALLY essential for example let's take a very minor issue. A variable reassigned to a different type, especially when using Class in object-oriented programming even if by mistake won’t be caught by python’s interpreter so developers will be facing a nightmare of run time errors which isn’t easy to debug in such a big scale environment while on a different language you would be able to see with just one TypeError message. This is why Microsoft made typescript as a superset of JavaScript. So they could introduce optional static typing to the language which I think is a step in the right direction which python should learn to follow.


Developers Logical Thinking (especially for beginners)


To prove this point I will quote from the one blogger who wrote about python's disadvantage.

 In my developer community, I always interact with Python and other programming language developers. and I have observed that those who work on C++ and other programming languages, most of the time they have better programming logic solutions as compared to those with Python. The primary reason behind this is that here you have inbuilt functions to do most of the things. I feel it’s spoon-feeding but at pretty much level it restricts your own logic development. (These people will never feel the pain caused by segmentation fault)


 I used to always wonder why universities teach C++ instead of python as an introduction to programming now I know 😂😂😂. It simple really if you were to ask one typical c++ or java programmer and another typical python programmer in the same room and provide them with a problem that needs a complicated algorithm to solve without using any third-party libraries we all know who would answer the question. And main reason programmers from other programming language backgrounds are better isn’t only because of the inbuilt functions alone but because python has soo many libraries and frameworks that you really wouldn’t need to build anything from the bottom you could just use other peoples libraries and packages.

 And one compelling reason I would advise you not to start programming with python is you will be a slave😂😂. From the developers I have met and worked with I have observed that people who learn to program with python often get too comfortable with python’s magical syntax, its inbuilt functions, and community support that they would rather not learn any other programming language out there. And its not only that the main reason they can’t move on to other languages is because its difficult to learn another language if you start with a python background. It would feel like a whole new world mainly because python has a very different syntax than most programming languages and its inbuilt features are quite different as well.

VERDICT

Python is a good language but it's NOT PERFECT so developer should weigh their options before using it in their large-scale programs. And for beginners I recommend you stop following the herd and sit back and decide. Are you trying to learn programming just for the fun of it as a hobby? Or are you serious about it being your profession? If your the first type go ahead and learn python, it’s a very capable language and you will be doing amazing things with it in no time. But if your the latter of the choice don’t start with python. I know it hard but trust me go and learn the basics of programming with other languages I recommend statically typed languages like the C family or java then later after you know the basics and are fed up with the other languages primitive syntax😅 then give python a chance I am pretty sure it will be a joke in the eyes of the other languages so you will be able to learn it in no time then you can get down to business with it because with python you can almost do everything.



Report Page