The History and Use Cases for Python
Although Python has now surpassed its thirtieth birthday, it continues to gain the attention of developers.
In 2020, Wired declared that Python is more popular than ever, and in 2021, Python overtook Java and C as the most popular programming language among developers. So, what exactly is it that draws so many developers to adopt Python as their language of choice?
Why Developers Are So Fond of Python
In the late 1980s, Guido van Rossum had become frustrated with the ABC programming language prominently used in the Centrum Wiskunde & Informatica (CWI). His frustration came from both the language's rigidity and its inability to handle abnormal conditions.
Seeking to build a viable alternative, van Rossum began developing Python as a hobby in the winter of 1989. After several years of work, he realized its completion in the early 1990s, naming it after the British comedy series Monty Python’s Flying Circus. Thereafter, van Rossum acted as its lead developer for almost three decades.
At the start of the millennium, Python reached a significant milestone. The release of Python 2.0 in October 2000 introduced new features into the language, such as list comprehension and garbage collection. On the heels of this new version arose the Python Software Foundation (PSF).
Python’s popularity began to skyrocket around the time of the global financial crisis in 2008, at which time it reached another development milestone — Version 3.0. This newest version accommodated changes to the print and integer division functionalities.
With economic recovery on the horizon, many financial institutions chose to relieve their processes of as many forms of human intervention as possible. They substituted artificial intelligence wherever they deemed suitable. When these prestigious organizations adopted data science and machine learning into their infrastructures, Python found a corporate niche where it could establish itself.
Python’s reputation quickly expanded as a robust, enterprise-ready language. It enabled developers to build solutions more rapidly than if they had used incumbent company-sponsored languages like .Net or Java. The tremendous cost savings during development became a crucial consideration in the wake of recent financial upheaval.
In 2018, van Rossum stepped down from his role as Python’s “benevolent dictator for life.” This was a prestigious title bestowed on him by the Python developer community, referencing his ability to give the final word in any debate or decision about the future of the language. Upon his retirement, the core developers elected a “steering council” to make any critical decisions that would affect the project's future.
A Simple Syntax
From the initial stages of its creation, van Rossum intended for Python to retain a relatively simple syntax that would make it incredibly approachable for experienced developers and inexperienced newcomers. This attainability has made it popular among most coding schools and ensured the availability of a virtually endless supply of tutorials. Most of these tutorials begin with the essentials and proceed across the spectrum to highly complex topics like machine learning.
The quantity and variety of these tutorials have made it easier than ever for the average person to try their hand at software development. Coupled with the growth of platform-as-a-service offerings (like AWS Elastic Beanstalk), access to Python has empowered people with little or no coding experience to more easily learn the skills necessary to build real-world projects.
Although its syntax is relatively uncomplicated, Python features the function and flexibility that more experienced developers require. Because it’s an interpreted language, it doesn’t require compiling, meaning that you don’t have to use it on a particular platform. It also means that you have access to features like dynamic typing, which allows you to quickly build prototypes without needing to worry about data types. However, it also comes with the caveat that Python performs more slowly than a compiled language.
Another factor contributing to its flexibility is the ability to combine Python with Java, C, or .NET, creating supersets like Jython, Cython, and IronPython, respectively. As a result, you can easily slot Python into existing architectures and avoid taking on extensive rewrites.
Powerful Software Libraries
Python's growth in popularity has led to a rich ecosystem filled with powerful software libraries. These libraries can accomplish an enormous range of tasks, from web scraping to machine learning. Such libraries enable virtually limitless possibilities with Python.
Use Cases
With Python’s extensive feature sets and compatibility, the ways it can be used are just as diverse and expansive.
Web Scraping
Web scraping (also referred to as web mining) is one application wherein Python excels. Pairing incredibly well with Python’s data science applications, web scraping allows users to access and analyze the nearly boundless supply of data available on the Internet. The data gathered from web scraping processes is an incredibly effective way to amass training sets for different machine-learning algorithms.
This data can come in different forms, including text, audio, and video. Additionally, data gathered in this way generally comes with linked data that provides any associated context. This is known as metadata. In addition to this metadata, any audio or video content collected can be processed using computer vision or transcribing software, which can transform it into additional text content or metadata.
BeautifulSoup and Scrapy are two of the most popular libraries used for web scraping. These libraries use HTTP requests to retrieve the raw HTML from web pages. You can code complex methods of navigating the Internet to maximize the amount of content. Conversely, they can use the same techniques to limit the harvesting to specific domains.
Internet of Things
As automation and smart home technologies mature, product adoption is rapidly increasing. Although smart home products are just one branch of the Internet of things (IoT), the concept has experienced skyrocketing popularity in recent years. Python makes several variations and libraries available to accommodate this surge in popularity. These libraries remove some of the heavy lifting from the programming side of building IoT prototypes, particularly given the scarce resources on these types of hardware.
MicroPython is a leaner implementation of Python designed for devices with resource constraints, making it ideal for IoT. It can run on just 256 kilobytes (KB) of storage and 16 KB of RAM while still providing much of the functionality Python users would expect. This allows MicroPython to function effectively on IoT hardware and provides a way to remotely connect with a more powerful server for more intensive data analytics and reporting processes. We can use the leaner MicroPython and the main Python versions alongside different packages to provide additional functionality.
For facilitating the communication between IoT devices, there are several Python libraries from which to choose. Paho-MQTT and Sockets remain two of the most recognizable examples. There are also packages like Mraa that simplify the logic required to connect to different GPIO sensor pins. In addition to these packages, the rise of DevOps tools like Docker and Kubernetes has resulted in more straightforward deployments across IoT fleets.
Game Development
A common motivation for diving into software programming is to build computer games. The Python community offers a handful of libraries to help with this, with PyGame featuring most prominently among them. While there are still very few examples of popular or widespread games developed with PyGame, Frets on Fire — an open-source music game in the same vein as Guitar Hero or Rock Band — is a fairly well-known example. This game has been well received, achieving over 14 million downloads since its release.
Data Science
Data science is one of Python's most exciting, innovative, and popular use cases. The recent surge in machine learning and deep learning research has led to the emergence of several major open-source libraries. These libraries include Keras, NumPy, Pandas, PyTorch, and TensorFlow. Each library provides the developer with an extensive array of mathematical functions that prove invaluable when working with vast amounts of multi-dimensional data.
Computer vision is one example of machine learning technology that has seen practical applications across various industries, including transportation and security. Computer vision is an umbrella phrase that encompasses a range of subtopics, including facial recognition and object detection. This technology takes image or video data and applies algorithms to identify and understand the visual content.
You can apply computer vision functionality when programming autonomous vehicles, smart security systems from companies like Arlo, and various identity verification mechanisms. You can even use it to assist with research into subjects like deforestation rates and tidal erosion or to monitor endangered species and poachers. You can choose from several libraries to perform computer vision tasks, including SimpleCV, OpenCV, and PyTorchCV.
Natural Language Processing
Natural language processing (NLP) is another application that benefits significantly from the machine learning that Python can enable. You can use the Natural Language Toolkit (NLTK) and spaCy to develop NLP tools. Such tools can apply significant amounts of detailed linguistics research to pieces of text or speech to achieve some very familiar functionality.
Optical character recognition (OCR), grammatical error correction, and text summarization have become vital NLP processes for commercial and personal use. Additionally, you experience NLP in products such as Amazon's Alexa devices, editing and proofreading tools like Grammarly, and countless versions of customer support chatbots.
Conclusion
More than 30 years after its humble beginnings, one man’s response to the limitations of the ABC programming language has become the language of choice for the majority of developers.
Those developers who foresaw Python’s potential established a diverse and rich ecosystem that continues to push the boundaries of programming possibilities. This ecosystem empowers new generations of developers to carry the torch that Guido van Rossum first lit.
As business landscapes evolve to use the most modern technology available, data science and machine learning are becoming ever more prevalent and essential within the corporate sphere. With the continued expansion of these fields at staggering speeds, and the adoption of Python by hugely influential organizations like Spotify, Facebook, and DropBox, it’s arguable that the Python ecosystem is still quite far from the true height of its success.