When you’re looking to build something, you want to be sure that you have the right tools. In many cases, the choice of tools will decide your entire experience. Choose the wrong tools, and you’ll pay the price down the line. Your work may be slower, your competition may outpace you, or your end result may fall below expectations. When you choose the right tool, you’ll be thankful for it every step of the way. If what you’re building is a software project for your company, your core tool is your programming language. Your choice of language at the start of the project will impact it profoundly in the future. It may make the difference between a smooth scaling experience and a costly refactoring, or between meeting your deadline and missing it. There are many good programming languages out there, and each may benefit your tech stack differently. Head over here to learn how Python compares to Golang, Node.js, or Java. However, if you want your software project to be a success, we recommend that you choose Python as your tool. Here are the main reasons why.
Python is popular and widely supported
Python is quickly ascending to the forefront of the most popular programming languages in the world. The incredible growth of Python is shown very clearly by StackOverflow:
Its continuous rise in popularity is reflected in the TIOBE index and Coding Dojo identifies Python as one of the most in-demand programming languages of 2019.
The demand for Python is growing with no signs of stopping, second only to Java, whereas the number of Java job postings is projected to decrease. It is likely that Python will overtake Java in the coming years, reaching the #1 spot.
Graph source: https://www.codeplatoon.org/the-best-paying-and-most-in-demand-programming-languages-in-2019/
How can you benefit from Python’s popularity?
The popular option isn’t always the best option. But when it comes to programming languages, popularity can pay off.
By using a popular language, you have a much higher chance of finding a solution to any problem you may encounter. In fact, if your issue is common enough, there’s probably a ready-made solution available in Python right now.
Python enjoys a healthy community of enthusiasts that strive every day to make the language better, fixing bugs and opening new possibilities.
At the same time, Python has some strong corporate sponsors that will push the adoption of this language even further—Google is one of them. Because Google uses Python, they are actively working on guides, tutorials and other resources to get the most out of it.
In fact, Guido van Rossum, the creator of Python, used to be employed at Google, where he devoted half of his time to developing our favorite programming language
Writing Python code is easy, which speeds up development
Python is accessible by design, making it one of the fastest languages in terms of speed of development. Just look at what Guido van Rossum had to say at the conception of the language:
The second stream of material that is going to come out of this project is a programming environment and a set of programming tools where we really want to focus again on the needs of the newbie. This environment is going to have to be extremely user-friendly.
- Guido van Rossum, former Benevolent Dictator for Life of the Python language (How cool is that title, by the way?)
A user-friendly environment in the hands of your development team means less time wrestling with your building tool and more time spent actually building.
In fact, Python’s simplicity was the reason STX Next came to be in the first place. Before he started the company, our CEO Maciej Dziergwa was a Java developer. Once he realized that he could recreate a 2-month Java project in a mere 2 weeks using Python, there was no going back.
Get a headstart with frameworks and libraries
Python is known for its rich selection of libraries, saving you the hassle of coding features by hand and accelerating time-to-market. If you’re looking for scientific libraries, there’s Pandas, NumPy, and SciPy, for example. Python even has specialized libraries for machine learning (scikit-learn, TensorFlow, nilearn) and natural language processing (nltk).
Aside from libraries, Python also offers a range of web development frameworks which you can use to jump-start your project and avoid unnecessary coding. Some frameworks, such as Django, give you everything you need to build a web application, from low- to high-end. Others are more specialized, such as the Flask micro-framework.
Whether you decide to use just a few libraries or decide on an entire framework, Python will help you get results faster.
What about performance?
The way Python is structured and Python code executes is not without its drawbacks. One oft-cited disadvantage of Python is its runtime, which is often slower compared to other languages.
And yet, Python is still the language of choice for companies such as Google. Why?
Because CPU time is rarely the limiting factor.
The limiting factor is your employee’s time.
You want to optimize your most expensive resources—and developer hours don’t come cheap. So you need all the help you can get to shorten time-to-market, even if it leads to slower runtime execution.
Mix it up with Cython
But that’s not all. For situations where performance really does matter, Python offers tried and tested solutions to incorporate other, faster languages into the code.
One such solution is using Cython. Usually, your performance bottleneck lies in only one of the methods in your code. You can use Cython to rewrite the method in C, optimizing your speed without the need to rewrite the whole code base.
Using Cython you get the perfect mix of optimizing only at the bottleneck, and the beauty of Python everywhere else.
And so, again, whatever your woes, Python has an answer.
Reading Python code is intuitive, making maintenance a breeze
Python’s syntax is clear and concise. The language is designed to be readable and close to actual English, making it easy to decipher. Python also requires fewer lines of code to achieve results compared to languages such as C or Java.
Python’s approach is so deeply embedded that you can even learn about it from Python itself. Here’s what you’ll see when you execute import this
in the Python interpreter:
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one—and preferably only one—obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea—let's do more of those!
(I learned this little trick from this article over at Full Stack Python.)
How do you benefit from readable code?
The simplicity of Python helps greatly when you have to read the code you’ve written, or code from another developer. Code review goes much faster when you have fewer lines of code to actually review, and the code reads like English. There’s also less “catch-up” involved when the code changes hands—you can figure out pretty quickly what each function is supposed to do.
With code that’s easier to understand and navigate, you can reduce the amount of work needed to maintain and expand your code base. And reducing work is one of the best things you can do, since we’ve already established above that optimizing programmer productivity should be your priority.
Python gives you tried and tested scalability
No one can really predict when your user numbers will start surging and scalability will become a priority. Which is why it’s a good idea to use a language that scales great and, as we’ve mentioned above, is easy to maintain.
Some of the most ambitious projects around the web—YouTube, Reddit, EVE Online—all use Python to serve their user base reliably.
To be precise, Reddit was initially written in Lisp, and was then rewritten in Python—over a single weekend. Here’s how the switch from Lisp to Python was justified on the Reddit blog:
We were already familiar with Python. It’s fast, development in Python is fast, and the code is clear.
/u/shuffman56 on choosing Python for Reddit
In short: if you dream big, Python has got you covered.
Summary
So let’s answer the question once and for all. Why Python? Because:
- you will write your code faster, optimizing developer resources;
- you will have access to tons of dedicated Python libraries and frameworks, so you won’t have to build everything from scratch;
- you will review your code more easily with a simple and clear language;
- you will enjoy support from guides and tutorials by Google and the Python community;
- you will use the same language that Reddit, YouTube, EVE Online and thousands of global projects have trusted.
If you really need to find the one language to rule them all, the choice is clear.
Further reading on Python
Not so long ago, Matthew Harris created a more specific guide to Python from the perspective of the fintech industry. Take a look at the reasons why Python should be the technology choice for your fintech.
Alternatively, if you’re curious which other fields benefit from using this programming language, check our comprehensive guide on what Python is used for.
Or, if you’re a Python developer, perhaps you’ll be interested in our new tutorial on getting started with machine learning in Python.
And if you’re here just for the language wars, look no further than our comparison of Python and other programming languages.