Python Today. What Is The State Of Python Development In 2021?
Aug 26, 20217 min read
Senior full stack developer and CTO at Ideamotive.
2021 is a difficult year and Python meets its challenges as strong as ever. For the first time in its history, Python has a real chance to hit first place in the TIOBE Index and become the most searched programming language in the world. The gap between the current number one and Python is only 0.7%. The other evidence of Python’s popularity is the results of the StackOverflow survey. 66% of developers mentioned that they enjoyed working with the language. 30% of engineers who have never before worked with Python replied that they would like to apply the language for their next project. Similar results are shown by Coding GameDevelopers Survey 2020. 36% of respondents marked Python as their most favorite programming language which provided Python with first place in the rating for the third year in a row.
Although it is hard to count the exact number of Python developers operating in 2021, we can make a rough estimation. According to SlashData, in 2018, there were 8.2 million Python developers in the world. The forecast for the next three years is the infusion of 6 more million new developers into the Python community.
Although the language was released 30 years ago, it is still a relevant tool for the development of applications. In 2021, Python is widely used by many IT giants, for example, by Google. 33% of company’s job advertisements mention Python which makes knowledge of the language the most required skill by Google. Golang, the coding system developed by Google themselves and optimized for the company’s needs, is mentioned only in 19% of the advertisements.
Why do so many people like Python today? The popularity of the language is guaranteed by its close to the natural English syntax and a good catalog of libraries and frameworks.
On July 2nd, 2021 Python’s productivity was enhanced by the release of the new version of the language, - Python 3.10. A new feature of Parenthesized context managers was introduced. Also, some new attributes and flags were added to the existing methods and the error reporting became more precise.
A year ago, Ideamotive wrote about Python, its peculiarities, and examples of applications. Now let's have a look at changes that happened to the language during this time.
After a month of beta-testing on July 2nd, 2021 the Python 3.10 stable version was released. There aren’t many new features in a new version of the language, but the one we have may be the most significant addition to the syntax since async. This feature is structural pattern matching.
So what structural pattern matching exactly is? The closest analogy is the switch-case operator from other languages, like Java. It allows performing actions based on the assertions on the input data. With such a feature, the range of possible scenarios is enriched. To apply structural pattern matching, two new keywords, match, and case, are required. To learn more about how structural pattern matching works, check the official tutorial.
In addition to new features, on version 3.10 the existing methods are further developed. A new attribute to the dictionary methods dict.keys(), dict.values(), and dict.items() was added. Previously, a return of those methods was a different view of a dictionary. Now, with the mapping attribute, it is possible to wrap around the original dictionary and return it when called as it is.
An optional strict flag was added to the zip() function. When set strict=True an error will appear if both inputs to zip () are not of an equal length.
For brevity, some changes were made to the union types. Now, they can now be expressed as X|Y, instead of Union[X,Y].
Pleasant news for IT engineers is the further improvement of Python error reporting. In version 3.9, a complete new parser was deployed and in version 3.10, it became even better. Now, error messages are as precise as never before. They provide the programmer with information about the error type and its exact place in the code. For example, the error message for the following code will look like this:
File".\test.py", line 1
SyntaxError:'(' was never closed
The succession of the development trend set with version 3.9 may be noticed in the cleanup of type hinting and annotations. In version 3.10, annotations are stored in __annotations__ and are evaluated altogether. Also, a conditional logic with the | operator is introduced. Now, while annotating data types, we can use | to denote OR.
Python Libraries and Frameworks
A benefit of being the most popular programming language in the world is the assistance of the community in the development of libraries and frameworks. The use of pre-written samples of code significantly shortens the development time and improves the final product. The quality of the final product is also better since tested by the community code usually has fewer bugs and vulnerabilities. Currently, there are around 137,000 Python libraries available for download. The most popular libraries are Requests, NumPy, Pandas, and Scikitlearn. The most significant frameworks are Django, Flask, and Kivy.
The most downloaded in the 2021 Python library is Requests. According to Github, the library is downloaded 14 million times per week. Requests is a convenient tool for scraping data from the internet. With this library, it is possible to write simple human-readable HTTP/1.1 requests. Applying Requests is the simplest way to prepare queries and interact with API.
The majority of computations in apps are performed with NumPy. It is a library that brings the computational power of difficult-to-understand languages like C and Fortran to Python. NumPy provides developers with multidimensional array objects and an assortment of routines for fast operations on them. Mathematical, logical, sorting, selecting, Input/Output, basic statistical, and other operations may be performed.
Another important library for the manipulations with numerical data and time series is Pandas. The core object of a library is a DataFrame: two-dimensional, size-mutable, potentially heterogeneous tabular data. The data may be imported from and exported into such file formats as CSV, Microsoft Excel, and SQL databases. Split-apply-combine operations on data sets are performed with a powerful GroupBy engine. A quick joint of data sets may be performed with such tools as pandas.DataFrame.merge() method and pandas.concat() function.
Visualization of data in Python is usually performed with the library called Matplotlib. With help of this tool, you can easily create line plots, scatter plots, histograms, pie and bar charts. The style of the plot is easy to customize with different colors, shapes of the markers, labels, and so on.
The most popular machine-learning library is Scikit-learn. Released in 2007 by David Cournapeau, it quickly gained popularity among scientists of different fields. Built on top of NumPy, the library allows to execution of such classification algorithms as random forests, support vector machines, k-means, gradient boosting, and others. For the improvement of performance, some scikit-learn algorithms are written in Cython.
The most popular in the 2021 Python framework is Django. According to Coding Game Developers Survey 2020, it is the eighth best-known framework in the world among all of the programming languages. The community of Django developers is rather strong. Currently, 2,058 developers contribute to the framework on Github on regular basis. As a technology, Django is a tool designed specifically for the development of websites with dynamic content. According to BuiltWith, there are a total of 27,122 live Django-based sites on the web.
Flask is the second most popular Python framework in 2021. 10% of Coding GameDevelopers Survey 2020 respondees answered that they know the framework, while Django is known by 16% of developers. As a lightweight web application framework, Flask is suitable for the quick development of MVP projects and microservices. The core of the framework is simple yet expandable. The database abstraction layer is excluded by default but may be obtained from other extensions. A convenient way of defining endpoints, building the HTTP responses, and handling the data requests is also provided.
Web2py is a full-stack framework with its own web-based IDE and deployment controls. The design of Web2py was inspired by Ruby on Rails and follows MVC (Model View Controller) pattern. The functionality of the framework includes a scheduler, 2FA helpers, and a nice ticketing system.
Kivy is a framework released in 2011 for the rapid development of mobile and desktop applications. The framework is cross-platform and the apps developed with it may run on Windows, Linux, Android, OS X, iOS, and Raspberry Pi. The graphics engine of the framework is built over OpenGL ES 2 which makes it highly performative. There are also a lot of widgets with the support of multi-touch. A cool example of the commercial app developed with Kyvi is Yeko touch control for Ableton Live.
When to Use Python in 2021?
As a technology, Python is indeed a universal programming language. It is a good solution for the back-end of web applications, mobile applications, data science, and machine learning.
The sphere where Python is applied most commonly in web development. A rapid tempo of life in 2021 puts high demands on the development pace. Quoting Hui Ding, Director of Engineering at Instagram, “Performance speed is no longer the primary worry. Time to market speed is”. From such a perspective, Python is a perfect tool for the development of a strong competitive web product. It will take only 5-6 hours for an experienced developer to build the basic blog website! More complex projects may be deployed in a month.
If you are expecting a fast growth of your business and are concerned about possible bottle-neck traps, we want to assure you, there is nothing to worry about. In the hands of qualified developers, Python is highly scalable. For instance, the team of Instagram currently manages more than 1 billion active users per month. Also, in 2018, Python-based MMORPG EVE Online set the Guinness World Record with the biggest online PvP battle with 6,142 players simultaneously fighting in an enormous conflict.
Although there are many other programming languages that suit better for the development of mobile applications, Python still is a good choice. The main advantage of Python is its cross-platform nature. Also, Python-based applications may be deployed rather fast which is important for start-up projects. The development process usually takes up to 8 months. If you already have a project brief and a team of programmers, production time may be decreased to 5 months. Read our blog post to learn in detail how the development of mobile applications looks like.
A simple Python’s syntax made the language extremely popular among data scientists. According to the study performed by SlashData in 2018, 69% of data scientists use Python for their work while only 24% use R. To make good research the scientist has to mine the data, process it, build the model, and visualize it. All of those operations may be performed with such libraries as Scrapy, NumPy, Pandas, Matplolib, and Seaborn. Check our blog post to find a detailed comparison of Python against other programming languages from the perspective of data scientists.
In 2021, the implementation of machine learning tools in marketing is a common trend. A well-set algorithm provides a better understanding of the company’s target audience. Data about clients’ preferences and buying behavior improve the personalization of ads and marketing propositions. Among other programming languages in 2021 Python appears to be the best solution for such projects. Such libraries as Scikitlearn, PyTorch, TensorFlow, and Keras significantly ease the development process.
Of course, the implementation of machine learning is a sophisticated task. The data should be clean and consistent. The right classification algorithm should be used. Luckily, Ideamotive has enough experience in developing machine learning. Check the case study of how Ideamotive assisted AICrowd to improve machine-learning code. The client already had a live platform, but it had a lot of bugs and malfunctions. Also, memory was used inefficiently. Our task was to review and refactor the code. After hard work, the majority of malfunctions were eliminated and the performance was improved. Contact us to hire true experts in the field!
As you have witnessed, in 2021, Python is still a great and beloved programming language. The community of developers is growing, new patches are released and extensions in the form of libraries and frameworks appear. The language is equally applied by small startups and tech giants like Google or Instagram. Whether you are starting a new enterprise or planning to update legacy software, Python is a great decision for the technology.
Looking for developers? There are dozens of Python and other devs in our network. We will make sure to connect you with talents perfectly fitted with your industry and company culture.
Dawid is a full stack developer experienced in creating Ruby on Rails and React Native apps from naught to implementation. Technological superhero, delivering amazing solutions for our clients and helping them grow.