Python is currently the most popular programming language. Many different people from children, students, teachers, researchers of all kinds (Social Sciences, Biology, Medicine, Economics…), experts in Finance, Insurance, Marketing, developers, analysts or data scientists learn it and use it in their fields of interest. In today’s post, we will try to explain why.
The most popular programming language at the moment.
How do you measure the popularity of a programming language? It depends on who you ask.
And for non-programmers, I’m sure this quote from The Economist will give you an idea:
“In the last 12 months, in the US, there have been more Google searches for Python than for Kim Kardashian.”
“Python has brought computer programming to a vast new audience”.
Is Python really more popular than Kim Kardashian in the USA?. Well, it seems so 😉 We will see some of the reasons, but first of all, let’s explain what Python is.
Python in a nutshell
To “warm up”, let’s start with a curious fact: Do you remember “Life of Brian”, the famous “Spam” spot? The name Python has no zoological connotation but is a tribute by its author to the unforgettable English comedy group Monty Python, protagonist of one of the best comedies in the history of cinema.
Let’s get back to being serious and start with a technical definition that we will be “unpacking” little by little:
“Python is an open-source, multi-paradigm, but mainly high-level object-oriented interpreted programming language. Its syntax emphasises code readability, which makes it easy to debug and therefore favours productivity. It offers the power and flexibility of compiled languages with a gentle learning curve”
From this definition, we will analyse the 5 reasons why Python has gained so much popularity in the last few years.
1. Python is an interpreted language
Python was created by Guido Van Rossum in 1991 as a general-purpose interpreted programming language.
What does it mean for a programming language to be interpreted?
Low-level languages, such as machine or assembly language, can be run directly on a computer. High-level languages, such as Java, C, C++ or Python itself, on the other hand, have to be reinterpreted (compiled) as low-level languages before they can be executed. This usually results in slower execution times. Nowadays, however, this is not a problem as advances in cloud computing make customised computing capabilities available at very affordable costs. How well the code is optimised also plays a role.
With Python, programming is easy
Programming in machine code is expensive and difficult. Python offers a syntax that is much simpler and closer to human logic. More readable code is easier to generate, debug, and maintain. As a result, the learning curve for interpreted languages is much smoother.
2. Python is powerful, flexible and versatile
Let’s see why this power and versatility. There is no shortage of arguments.
It is a general-purpose language
Being a general-purpose language, and not created specifically for web development, Python allows you to create all kinds of programs and tools.
It is compatible with other programming languages
Its interoperability with other programming languages such as C, Java, R, etc., is another factor that has helped its widespread use in different fields.
It allows you to work with different programming models
In Python, everything is an object. However, although it is mainly an object-oriented language, it combines properties of different programming models or paradigms (imperative, functional, procedural or reflexive).
It offers libraries and environments specialised in a wide range of topics.
On the other hand, Python offers very powerful libraries and development environments for Machine Learning, Science, data visualisation etc.
- Linguists analyse texts with NLTK (the Natural Language Tool Kit),
- Statisticians use Pandas to analyse data.
- IT teams set up and manage resources in the cloud with OpenStack
- Developers use Django to create web applications
It is the language of reference in Data Science and Machine Learning.
In fact, it has become the reference language in Data Science, being the language of choice for 57% of data scientists and developers. If we take into account the evolution in the last two years of Python environments for Deep Learning, including the creation of Tensorflow and other specialised libraries, it will come as no surprise that it has left behind other languages such as R, Julia, Scala, Ruby, Octave, MATLAB and SAS.
It is the language of reference in Education
The fact that it is such a simple language that it can be used by beginners to professional programmers has also made it the programming language of excellence in educational environments. And not only because of its simplicity, but also because it can be run on different operating systems (Microsoft Windows, Mac OS X, Linux, or using the corresponding interpreter). It is also accessible through web services such as Python Anywhere.
This is especially important for the education sector because it can be used from computers in school classrooms, or even at home, without the need to install additional software.
Thanks to this, Python has been at the centre of several very interesting educational projects, such as the ones we will see below.
In 2015, the BBC launched the MicroBit project. This is a small programmable device, micro:bit, which aims to inspire a new generation of creators, makers and coders, aimed at children from 11 years of age.
Other projects, such as the MicroPython project, allow you to work with other small devices, such as Raspberry Pi, and can be used as the basis for many interesting and entertaining electronics projects to control screens, speakers, microphones, motors, etc. You can even create simple robots.
In short, Python can be used to create all kinds of tools, can be run on different operating systems, is compatible with other programming languages and offers libraries and frameworks specialised in different areas of knowledge.
3. Python is a free software project.
The Python Project was born as a free software project. Until very recently, it was still run by its creator, Guido van Rossum, who, in another nod to Monty Python, was the “Benevolent dictator of life” of the PSF for almost three decades.
What characterises free software?
Free software is not necessarily always free (although Python is), but is characterised by the scrupulous respect of the so-called “4 freedoms”:
- The freedom to use the program, for any purpose. (freedom 0)
- The freedom to study how the program works, and adapt it to your needs. (freedom 1)
- The freedom to distribute copies, so you can help your neighbour. (freedom 2)
- The freedom to improve the program and make the improvements public to others, so that the whole community benefits. (freedom 3)
For freedoms 1 and 3 to be possible, it is necessary for users to have access to the source code of the programs.
In short, free software are those programs that once obtained can be freely used, copied, studied, modified and redistributed. Therefore, the “freedom” of software is related to the permissions that its author offers
and not to its price.
Python is released under the Python Software Foundation License. The PSF is a non-profit organisation, which was created in 2001 with the aim of managing the project (development, rights management, fundraising, etc.). And it is compatible with the GNU GPL (GNU General Public License, from version 2.1.1).
4. Python is an open source language.
In addition to being free, Python is an open source language, which is similar, but not the same thing. According to Richard Stallman, both free software and open source pursue a common goal: to give greater freedom and transparency to the software world. However, they differ in the way they go about it.
Free software is defined by its ethics. Not only programs whose code is open source are considered free software, but all programs that respect the four essential user freedoms defined by the Free Software Foundation (1985).
The concept of open source software emerged in 1998, when the OSI (Open Source Initiative) was created as a split from free software. In this case, instead of the 4 freedoms of free software, 10 requirements were defined, which a software must fulfil in order to be considered open.
The main difference between the two types of software is subtle. Free software prioritises ethical aspects, while open source software prioritises technical aspects. Therefore, it is usually less strict, so that all free software is also open source, but not necessarily the other way around.
In any case, Python is free and it is open. And therein lies one of the keys to Python’s success: the Python community. It is a large and very active community, which contributes to the development and improvement of the source code, according to the needs and demands of users. Although many companies and organisations, such as Google, Microsoft or Red Hat, make extensive use of this language and have an influence on its evolution, none of them have any control over it.
Its free and open character has undoubtedly also facilitated the versatility, flexibility and power mentioned in the previous point, since in addition to all of the above, Python is a multiplatform language. That is, we can run it on different operating systems such as Windows or Linux simply by using the corresponding interpreter.
5. And also… it’s free
As we mentioned before, despite the confusion that may arise from the fact that, in English, “free”, in addition to being free, means free, free software does not necessarily have to be free. However, it can be affirmed that to program in Python, it is not necessary to pay any kind of licence fee. However, we must never forget that any code not developed by ourselves may be subject to some kind of licensing.
In short, Python’s simplicity, versatility and power have made it the all-rounder programming language that can help boost the digital literacy of broad sectors of the population, making programming accessible to people and professionals of all kinds.
What about you? Do you dare with Python?
You can read the original post in Spanish here.