Computer programming dates back to early 1800s, and since then, the human race has created more than 8000 programming languages. We are talking about a journey so long that it's hard to cover every advancement that has been. But this slithering programming language started it's journey in late 1980s. Guido van Rossum conceived it at CWI in Netherlands. It was created as a successor of the ABC programming language, which was inspired by SETL, a very high-level programming language based on Set Theory. However on 12th July 2018, Van Rossum announced his permanent vacation from the project's "lead developer" or "benevolent dictator for life", the title bestowed upon him by the Python Community to reflect his long-term commitment as the projet's cheif decision-maker. However, in January 2019 the active core developers of Python elected a five-member "Steering Council" to lead the project.
In 1999, Guido van Rossum defined his goals for Python as follows,
As a fellow Pythonista, I can tell that he was a man of his words. Also, the current developers still keeps everything as simple as possible, as Van Rossum wished, understandable as plain English.
You try to be simple and easy to understand and people will start liking you as well, same goes with my buddy Python. YES! we are friends, and NO! that's not weired. The point that it's not a complex language is a very important point. The community's ancestors placed less empasis on the conventional syntaxing, wich makes it easier to work with, even for non-programmers. Not only that, python can do nearly everything you can imagine. For examples, you can control your room or your office by scripting a Raspberri Pi using Python, you can develop artificial neural networks to train them into doing some tasks, you can also automate several day to day tasks using simple python programming.
If you didn't understand the terminologies in the last sentece go and search for them, they are really interesting or may be I can write a blog if you want, just send a mail.
Python also has a active, healthy and supportive community going for it. This community helps ensure that developers of all levels, beginner to expert always have somewhere to find help. If a programming language has a corporate sponsor, it helps big time. Like Facebook uses PHP, Java has Oracle, C# has Microsoft. Around 2006, Google adopted Python heavily and used it for many applications and platforms ever since. Again, Google also held the torch and made vast quantity of tutorials and guides for working with Python, because to hire future developers they wanted them to know the ways of Python, which again contributed to it's fame.
Data Science was named the sexiest job of the 21 st century by Harvard Business Review, in 2012. And the most popular language to facilitate data scientists with the tools to perform this sexy job is Python, which is second only to R programming language.
As a python developer, I can assure you that Python is really fast and powerful. May be not as fast as C or C++, but hey they are not that easy to learn and code in. I'll discuss why it isn't as fast as those two. Not to mention Python has a vast number of libraries and the community just keeps adding to it everyday. Python's application base is so vast, like web development, automation, desktop application, hardware control, data science, machine learning, artificial intelligence; you name it, my buddy can do it.
I can just go on for paragraphs after paragraphs praising Python, and if I keep at it this blog is never gonna end. Also we have other points to cover.
When we write a program in C or C++, we have to compile it first. Compilation translates the human understandable code into machine understandable code, or Machine Code. Machine code can be directly executed by the CPU. Upon successful compilation, an excutable file is generated. Which on executing, runs the operations in our program step by step.
Whereas in case of Python, it is described as-
Python is an interpreted high-level general-purpose programming language. It is is dynamically typed and garbage-collected.
-by Wikipedia
So you see Python is not a compiled language instead a interpreted one. Although, compilation is a step. A python file with an extension .py is compiled into bytecode. You can think of byte code as a series of instructions or a low-level program for the Python interpreter. So, there is no machine code, then how is it executed by the CPU. Well, the bytecode is executed on a virtual machine. Those of you familliar with Java and JVM will understand it better. Same as Java, Python is also platform independent. As long as the generated bytecode and the Virtual Machine has the same version, both Python and Java can be executed on any platform. Now I can also tell you why is it slower that C/C++. Think of it as a translator sitting their to translate your native language to someone else's native language, where as if you know the native language of that person the conversation will be faster. This is kinda one of the disadvantages of interpreted languages like Python. I have seen mainly two types of interpreters, CPython and JPython. CPython means that hte interpreter was impleamented in C language, the other one means in Java. I don't know if you ever noticed the folder named "__pycache__" in you directory, that folder contains a file named same as your program file but with an extension .pyc, which indicates that the file contains bytecode for you program. Unless you change your Python code, recompilation to bytecode is avoided which slightly increases the execution time of your program.
The term dynamically typed means the interpreter validates the variable type and the operations performed on it. Whereas, in strictly-typed languages like C/C++/Java we have to initialize the type of the variable. So, as you can see interpreter got one more job on it's plate so it's obvious it takes some time for it to tell the VM what needs to be done.
Now let us see what garbage collection is. In C/C++ memory allocation is somewhat manual. If we are not referencing a variable anymore, we have to clean it up from the memory. But if you are using Python, Garbage Collector does that for you. The Garbage Collector keeps track of the references made to an object, if at any point that number goes down to 0, it deletes that object. This process is termed as reference counting which is by default enabled in Python and can not be disabled.
After reading all these, I hope I don't need to explain anymore about how Python started swallowing the market. Also you can check it's ranking among other programming languages here on this link - https://www.tiobe.com/tiobe-index/