Impact of Coronavirus on Python Programmer
Ever since Python was released in the early 1990s, it has generated a lot of hype. Sure, it took the programming community at least 2 decades to appreciate its existence, but since then, it has far surpassed C, C#, Java and even Javascript in popularity.
Do you hold onto old stuff just because you can’t bear to throw it out? Me, too. I’m guilty of collecting a lot of different things — shot glasses, ball caps, mugs from my travels… it doesn’t mean anything. It doesn’t add anything to my life.
As we grow older, people move away, they get married, they have kids, and they immerse themselves in their lives. While your inner circle might shrink, the other people aren’t just gone. You’ll be able to pick up right where you left off as soon as you meet up.
Your body is the only one you’ll have for life. It’s much easier to stay in shape when you were in shape to begin with. It’s much more difficult to get in shape when you’ve let yourself go a bit.
Although Python dominates the fields of Data Science and Machine Learning, and, to some extent, Scientific and Mathematical computing, it does have its share of disadvantages when compared to newer languages like Julia, Swift and Java.
What made Python so popular?
One of the main driving points behind Python’s meteoric growth was how easy it was to learn and how powerful it was to use, making it extremely appealing to beginners and even those who shied away from programming because of the hard, unfamiliar syntax of languages like C/C++.
The language, at its very core, emphasised extensively on code readability. With its concise and expressive syntax, it allowed developers to express ideas and concepts without writing tons of lines code (as would be the case in lower-level languages like C or Java). Its simplicity a given, Python seamlessly integrates with other programming languages (like offloading CPU-intensive tasks to C/C++), making it an added bonus to polyglot developers.
Yet another reason for Python’s versatility is its heavy usage by enterprises (FAANG included) as well as countless smaller ventures. Today, you’ll find a Python package for pretty much anything you can think of — for scientific computing, you’ve got Numpy, Sklearn for Machine Learning and Caer (my Computer Vision package) for Computer Vision.
Python’s Got Weaknesses
It’s slow, terribly slow
Image for post
Image for postImage for post
Image for post
Image for postImage for post
Photo by Nick Abrams on Unsplash
This is probably a no-brainer. Speed is generally considered to be one of the key focuses of a developer and will probably continue to be for an unforeseeable amount of time.
Among the major reasons why Python is “slow”, it really boils down to 2 — Python is interpreted as opposed to compiled, ultimately leading to slower execution times; and the fact that it is dynamically typed (data types of variables are automatically inferred by Python during execution).
In truth, this argument that “Python is slow” tends to factor a lot among beginners. Yes, it’s true. But only partially.
Take, for example, TensorFlow, a Machine Learning library available in Python. These libraries were actually written in C++ and made available in Python, sort of forming a Python “wrapper” around the C++ implementation. The same goes for Numpy and, to an extent, even Caer.
It’s got a GIL(l)
One of the major reasons for Python’s slowness is the presence of GIL (Global Interpreter Lock) which allows only one thread to execute at a time. While this boosts the performance of single threading, it places a limitation on parallelism where developers have to implement multiprocessing programs as opposed to multi-threaded ones, to improve speeds.
Not the best for memory-intensive tasks
When objects go out of scope, Python has automatic garbage collections. It aims to remove a lot of the complexities involved in memory management that C and C++ involve. Owing to the flexibility (or lack thereof) of specifying data types, the amount of memory Python consumes can quickly explode.
Moreover, some bugs that may go unnoticed by Python may pop up during runtimes, ultimately slowing down the development process by a considerable factor.
Weak Presence in Mobile Computing
The Rise of Other Languages
Recently, newer languages like Julia, Rust and Swift have popped up on the radar, borrowing a lot of the good design concepts from Python, C/C++ and Java — Rust pretty much guarantees memory safety and concurrency at runtimes, and offers first-class interoperability with WebAssembly; Swift is almost as fast as C due to its support for the LLVM Compiler Toolchain, and Julia offers asynchronous I/O for I/O intensive tasks and is blazingly fast.
Conclusion
Python was never built to be the best programming language. It was never built to take on C/C++ and Java. It was built to be a general-purpose programming language that emphasised on human-readable, English-centered syntax that allowed for the quick development of programs and applications.
Python, like every other language at the end of the day, is a tool. Sometimes, it is the best tool. Sometimes it’s not. Most often, it’s “just okay”.
So, is Python as a programming language, dying?
I hardly think so.
Is it losing its charm?
Ah, maybe just a bit. Just a bit.