Nowadays there does exist many programming languages and Python is one of these which often comes under limelight. As per surveys conducted by SlashData, there are over 8.2 million developers who use Python programming language for their work. That's a lot, so there must be some strong reasons Why they use Python? If you come to me and ask why I would prefer using Python over other programming languages then my answer would be Code Quality, Developer Producticity, Portability, Support for libraries and Easily integrateability.
Code Quality
From experience of working at multiple startups and some other big companies what I've realised is that Most of Developers spend their time on trying to figure out what code is required for implementing certain functionality. But Python's feature of Easily readable, coherence makes it unique and quite easier to implement functionality.
- Python is designed to be easily readable
- Easy to implement code in some specific techniques like Object-Oriented and Functional Programming
Developer Productivity
Owing to simpler syntax, easily readable Python reduces time to implement functionality way lower as compared to other programming languages like C. Also in Developer community people jokes about Python saying "Python code is one-third to one-fifth of equivalent C++ code".
- Lesser time to write Python code
- Lesser time to find bugs and do debugging
- Less time to maintain code over time
Portability
As Python is interpretable that's why it could be easily ported from Windows to Mac or to Linux, it's just matter copying a script over. But for so many other programming languages so many things need to be kept in mind before porting over. For example - For running same C++ code using gcc on Mac and then transferring over it to Windows, Developer need to keep in mind that there does exist some differences between gcc on Mac versus on Windows. So before porting over some things need to be fixed.
But that's not the case with Python.
Python can be easily ported from Windows to Mac or some other operating system.
Support for Libraries/Modules
Python comes with a number of modules beforehand, so you don't need to explicitly write code doing some stuff. For example - Doing a search through a text file of 100000 lines is so easy that it can just be done in three lines of code using re python module.
In addition to a number of internally defined modules like array, calendar, email and many more. There does exist many libraries externally specifically designed for Data Science Purpose. Some of python libraries designed for doing Data Science are -
- Numpy
- Scipy
- PyTorch
import re
txt = "Computer Science Hub"
x = re.search("Hub$", txt)
if x:
print("Yes, txt have Hub word")
else:
print("No, txt doesn't have Hub word")
Easily Integrateability
Nowadays most of code need to run across multiple platforms either it in hand of users as SmartPhone or on lap of users Laptops. That's why most of Software need to work across platforms, but I believe that it would be meaningless if a company's engineering team spends 6 months on developing a piece of software and then spends another 6 months for making it to work across platforms.
But that's not the case with Python Programming Language you can easily integrate it with other programming languages to make it work across platforms.
Not only that you can easily integrate C++ code with Python, providing access to low level of memory if you need to explicitly do Memory Management while coding in Python.
Conclusion
From experience of learning Python at university to working as a Python Developer, I've realised that most people prefer python because of this one single reason - Easy to read and write. Also most of software engineers have started their programming journey by first learning Python.
Personally I also recommend to learn Python first and then move onto learn some low level language like C++, because understanding under the hood stuff is really crucial to develop reliable, cross-platform and scaleable software.
Do comment down below why like Python or prefer it over other programming langauges.
Happy Coding 🥳
Top comments (2)
Python is my favorite programming language, but I will strongly disagree with the statement that python (or any other language) is the best programming language. For machine Learning/AI, yes, sure, it may be the best (some people may argue here too), for embedded systems, not even close.
Furthermore, some of your comparisons don't really back up the fact that python is the best. For example: is python easier to read and write than C++? Yes, for sure, but at the same time python is so much slower to run than C/C++. Is python more portable? yes, but again it sacrifices speed for that.
So when you argue that it is the best, you also have to state for what tasks it is the best. If you need speed and low memory usage than you have to stay away from python. If you want to quickly implement or test something and the resource usage isn't important, than python may be a good choice.
If the main reason to like python is becayse it is easy to read and write, you will love ruby.