Codementor Events

How Python Became the #1 Programming Language and How You Can Make the Best of It

Published Oct 18, 2021Last updated Oct 28, 2022
How Python Became the #1 Programming Language and How You Can Make the Best of It

According to one popularity ranking, Python is now the most popular programming language in the world.
Programming languages’ popularity rises and falls over time. TIOBE, a Dutch software quality assurance company, has been tracking the popularity of programming languages, and its CEO, Paul Jansen, notes that

“For the first time in more than 20 years we have a new leader of the pack: the Python programming language. The long-standing hegemony of Java and C is over.”

Python has been around since 1994, and it is the winning programming language these days. Python’s move to the top spot on the Tiobe index started back in 2018. At that time, its rating was 4%, and it then started its rise. Now it has overtaken Java and C for the first time and has become number one.

Programming Language Rankings

TIOBE bases its ranking on queries on the major search engines. Other rankings use different criteria and disagree on whether scripting languages, namely JavaScript or markup languages, such as HTML, should be on the same ranking. In any case, Python is currently number 1 on many and top 3 on all.
IEEE Spectrum – created by combining metrics from eight sources: CareerBuilder, GitHub, Google, Hacker News, IEEE, Reddit, Stack Overflow, and Twitter.

  1. Python
  2. Java
  3. C

PYPL index - created by analyzing how often language tutorials are searched on Google

  1. Python
  2. Java
  3. Javascript

StackOverflow Developer Survey - their ranking includes programming, scripting and markup languages

  1. JavaScript
  2. HTML/CSS
  3. Python

Github 2.0 – created from quantitative data collected from the GitHub Archive dataset

  1. Javascript
  2. Python
  3. Java

Other languages that are part of the top 10 in Tiobe’s October 2021 index are C++, C#, Visual Basic, JavaScript, SQL, PHP, and Assembly. Also rising and in the top 20 were Go, MATLAB, and Fortran.

The official Python tutorial opens with a clarifying statement

Python is an easy to learn, powerful programming language.

Paul F. Dubois, Ph.D. and lead developer for the Numerical Python library, puts it in the way I like to think of it

Python is the most powerful language you can still read.

All in all, I think there are three main reasons why Python is popular:

  1. It is an easy programming language to learn, with straightforward syntax
  2. Its simplicity lets you become productive quickly
  3. It has abundant and convenient data science and machine learning libraries like NumPy, PyTorch (Facebook), TensorFlow (Google), Keras, and Pandas.

As the Python language evolves and gains even more momentum, its capabilities will become all the more powerful. However, the real challenge is how you can make the best of these capabilities for your project, be it small or big. Let’s look at some tips and tricks so you can choose the ones that make sense in your context.

4 Python Tips and Tricks to Make your Life Easier

Tip 1 - Leverage the best ideas of modern Python

As I write, the latest stable release is Python 3.10, released on Oct 4, 2021. So the first tip is that you keep informed and don’t limit yourself to what was available in the earlier releases of Python.
Along the same lines, don’t limit yourself to what you were used to in other programming languages if you already were used to C, Java, or something else. Yes, you can search the web and a multitude of good reference Python books, but If you’ve never heard of descriptors or decorators, you will probably not search for them, right? Make sure you don’t end up not using those features just because they are specific to Python.


SEE: Real Python - How You Can Switch Languages And Get Up to Speed With Python as Quickly as Possible


Tip 2 – Make use of the Python integration possibilities

When Python started, its key feature was that it worked the same no matter the operating system. With the advent of cloud computing, web-based applications, and reliable virtualization software, that is no longer the key aspect. The key is now that Python can be the “glue” in a software project, allowing programmers to integrate with other pieces of software in a reliable and maintainable way.
For this integration, you would traditionally use APIs. For each piece of software you wanted to connect to, you would have to find out how to use that API in Python.
However, the current trend is to simplify and use a pre-done middleware. You can use the same middleware to connect to different software, ensuring you finish the project quicker. More importantly, it also means you don’t have to worry when that other software is upgraded, making for easier maintainance.


SEE: Connecting Software - Getting SharePoint data in Python scripts – a tutorial using Connect Bridge


Tip 3 – Make use of all those Python libraries

The Python ecosystem is enormous, with a vast scope and depth. Making your way through this open-source forest is intimidating and requires continual effort to keep up-to-date with the best libraries for what you want to achieve.
Libraries like boltons can make all the difference in a project (boltons contains over 250 BSD-licensed utility types and functions that can be used as a package or independently). Even the standard library has less-known modules, such as collections, contextlib, concurrent.futures, logging, and sched.


SEE: Codesera - Top 12 Python Libraries For 2021


Tip 4 – Leverage existing data structures to make code shorter and more readable

Python is, in its nature, a programming language that allows for short, clean and readable code. This tip focuses on leveraging that when you use the high-level data structures available. Whenever you are using a data structure, you should check if you are using it in the right way. Let’s take the example of Dictionaries (dict). When using a dictionary, you will often see code that tries to catch a KeyError exception, something like

def get_items(basket, item):
    try:
        return basket[item]
    except KeyError:
        return None

But there is a get function readily available in dict that can make the code shorter, and, at the same time, more readable. A win-win situation:

def get_items(basket, item):
    return basket.get(item)

SEE: Towards Data Science - 15 things you should know about Dictionaries in Python


Wrap Up

Python became the number 1 programming language in the world by catering to a specific niche very well (the data science and machine learning area) while, at the same time, being an easy to learn and powerful language that can be widely used.

Keep in mind that you still have to focus on the specific project you have in hand to get the best results with Python. Make sure you use the latest features of Python and that you use the libraries and tools that make your life easier:

  • If your project requires data to come or go into existing business software like Microsoft Exchange, Microsoft SharePoint or others, we recommend Connect Bridge.

  • If your project can make use of an existing library, do not hesitate.

  • If you have a fresh project, use the latest Python version and code in a "pythonic" way to make the most of it.

Discover and read more posts from Ana Neto
get started
post comments3Replies
Sukhmani Kaur
8 months ago

Wow, Python’s journey to the top is quite a success story! It’s no wonder with its user-friendly nature and those awesome libraries. And hey, speaking of making life easier, have you tried out https://jsonviewer.ai/? It’s been a lifesaver for me when working with JSON data alongside Python. Definitely worth checking out!

Vu Vincent
a year ago

I think so. Generate QR codes free of charge with our efficient https://qrgateway.com/ QR Code Generator. Create codes for websites, business cards, and more.

Ben Rogers
a year ago

I want to study Python Programming, but due to the huge number of assignments, it is hard to find free time. One of my group mates recommended to check here https://edubirdie.net/blog/is-edubirdie-legal-or-cheating review of the resource that help me to get tasks done in short time. Thus, I will have a chance for learning python programming.