Table of contents:
- What is Python?
- Python Web Development - pros and cons
- Python vs. other programming languages
- Top Python frameworks
- Python for Startups
- In which industries Python is widely used?
- Is Python safe? Python for IT security
- Machine Learning with Python
- Python is everywhere
Before answering the title question, I should explain what the Python is. If you’ve already searched for some information about this programming language on Google you’ve probably come across… Monty Python. And, what’s surprising, there is a certain relationship between Python and this British comedy series from the 1970s. Python is an object-oriented, high-level programming language that is often chosen as one of the first to learn by the beginning developers due to its simplicity. It was released in 1991 and created by a Dutch programmer, Guido van Rossum. As he explains, when he started implementing this language, he needed a name that would be short, easy to remember, and mysterious at the same time. At that moment he was also reading a published script from ‘Monty Python’s Flying Circus.’ And basically, that’s where its name comes from - nothing to do with snakes.
If we have a glance at the TIOBE index for June 2019, we can conclude that Python is not the most popular programming language. But as you look at the bright side of life (and whistle now, if you want) and the popularity growth rate- it seems to be a matter of time for Python to hit the top of the list and. It joined Java and C on the podium and continues to soar. TIOBE predicts that if Python keeps this pace, it will probably replace these two technologies in 3 to 4 years.
Source: TIOBE index for June 2019
Along with the buzz around Python goes its growing frequency in utilization within web and app development, especially in some industries and particular types of projects like Machine Learning. Let’s try to find out why this technology is climbing the charts.
As I mentioned before, lots of companies decided to use Python to create their apps, systems, web sites, and other solutions. There has to be a good reason why such digital giants as Google, Instagram, Facebook, Netflix, and others have chosen this programming language, and well, there is even more than one reason. Here I listed some pros of Python development:
- Simplicity - many developers, point out that Python is very intuitive and simple language, which makes code reviews and debugging much easier and faster. As we can read on the official Python’s site, coding with this technology is even five times faster than using Java.
- A glue language - in many cases, Python is used as an integration language. The “glue” extension allows you to call C/C++ data types, so it’s easy to combine all the existing elements. Many companies decide to write only the performance-critical parts in Java or C++ and utilize Python for higher-level customization.
- Versatile - with Python you can program on all types of platforms, whether you need to write a code for Windows, MacOS or Linux, this technology can be your choice for backend development.
- Large and active community - thanks to its growing popularity, Python has a large community of developers, which means you can count on a wide range of skilled professionals. What is also worth mentioning is that Python offers a variety of libraries and packages that make developer’s work even faster and smoother. They are very helpful when it comes to Machine Learning projects, which I’m going to cover later in this post. There are also a few useful frameworks for this technology, like Flask or Django, that, among others, allow you to improve your project’s security.
Of course, I don’t want it to look like Python is a silver bullet for whole software developments. There are few cons of Python, and here I point out some of them:
- Speed - its code is executed line by line, and that makes Python slower than other popular languages like C or Java.
- Simplicity - one of its main benefits might turn into Python’s disadvantage. The fact that it’s so simple makes it difficult for developers to learn new languages, which can hinder their self-development.
- Not so mobile - although Python is widely used in web development, it’s not so convenient to work with when it comes to native mobile development. It performs much better with web applications or apps built with cross-platform frameworks, like r.g. React Native - later in this article, I’ll show you an example of this combination.
- More testing - Python is a language that requires more testing, and some bugs show up at runtime.
The list of Python’s advantages would be much longer, but I decided to divide Python’s pros into the different sections. So if you are still wondering what is Python used for, read more to find out its advantages for startups.
Python and other backend development languages have many things in common, like for example cross-platform support. But there has to be something that distinguishes each of them. Let’s take a closer look:
A few years ago these two technologies went head-to-head in the top 10 most popular programming languages ranking, but now Python finds itself in the third place, and Ruby is out of the top 10. Ruby is used more often than Python when it comes to mobile app development. At its popularity peak, developers admired the flexibility of Ruby as you can achieve one goal in many different ways. Ironically, that contributed to the decrease of this programming language. Python has won with its simplicity, as this technology aims at having only one easy way of solving a task.
Both languages are object-oriented, but Python is dynamic, and Java is a static technology. Static codes are more extended, but they have the advantage of avoiding runtime bugs. It also means that the syntax in Python is much easier in comparison to Java’s strict syntax rules. Both languages are very popular when it comes to backend development, and that means that you can count on a wide and engaged community. They are also provided with well-performing frameworks, but Python gives you more possibilities when developing a Machine Learning project. But the statistic mentioned at the beginning of this article shows that Python is growing and Java’s popularity is gradually decreasing, and that’s probably because of Python’s simplicity and other pros listed here.
Over 80% of websites are written in PHP, and that’s mostly because of its ability to insert the code into HTML easily. What’s more, lots of popular CMS, like Wordpress, are using this technology. Both Python and PHP are powerful programming languages, and Python is gaining ground thanks to its flexibility and readability. The choice should depend on your needs - if time is money for your business, you should choose Python. The truth is that every good software house should have both Python and PHP developers on board.
Actually, some crucial performance sections of Python are written in C. The main difference between them is the same as in the Python vs. Java case. Python is dynamically typed, and C++ statically typed language. C has been present in software development since the late ’60s, so it has a strong heritage that Python needs to overcome. C/C++ are error-prone and difficult to read, so Python with its readability and speed of developing is on its way to break C’s domination.
Frameworks help developers save time because they don’t need to start their project from scratch. Python’s community is large, and that’s why it offers you plenty of frameworks that can improve and speed up your work. I don’t want to focus on all of them here, that’s why I would like to mention two most popular: Django and Flask.
- Django - at its beginning it was positioned as a Python’s answer for Ruby on Rails. And probably Django’s popularity was one of the reasons why Python could overcome Ruby. Now it’s the most widely used Python framework. It provides you with all you need to build a web application with a pragmatic and simple design. It is open sourced with extensive documentation, which distinguishes it among other Python frameworks. Django is also known for taking the security very seriously.
- Flask - is considered more comfortable to start working with for beginners than Django. Flask gives more space to the developer, it won’t do the job for you, so you have to write the code from scratch, but thanks to this, its structure can be more customized. That is also why Flask is widely used in a microservices architecture.
Reading this article, you may have the impression that having a website or an application built in Python is a privilege reserved only for the most prominent players on the market with a thick wallet, or more precisely - unlimited budget. So if you consider using it, you might think like barking up the wrong tree, especially when you run a startup. Well, nothing could be further from the truth as Python is an excellent choice for startups. Why? First of all, let’s take a look at what is essential for most entrepreneurs at the beginning of their journey with creating the web or mobile app:
- Easily and quickly built the MVP version;
- Fast iterations;
- Having a possibility to implement new features when it’s needed;
- Relatively low cost of development due to a limited budget;
- Scalable business.
Does Python meet these needs? Let’s focus on its advantages for a startup project.
As mentioned above - according to the TIOBE index for June 2019, Python is still growing and gaining the ground on software development. And that provides a startup the possibility of choosing the right people from the wide range of professionals. What’s more - for a startup it’s necessary to deliver a cutting edge solution that responds to current needs, and that’s why it’s important to know what’s trending right now in the web development - qualified developers will ensure that.
One of the most significant advantages of Python is the fact that it helps you to scale your business. When preparing a strategy, you need to focus on technology that won’t limit your growth, and that will help you achieve flexibility. As we’ve mentioned above, Python is easy and intuitive, so changing the code and adding new features when it’s necessary won’t be an insurmountable problem for you. Python is the technology that will help you prepare a long-term growth strategy.
Short Time to Market
This value is closely related to the mentioned above as the startup’s most crucial need is to release the MVP to attract investors’ attention quickly. Python is the best way to do that because it allows you to achieve high quality with a smaller amount of lines of code, so it just takes less time.
Easy integration with software
It doesn’t matter if you need your solution to work on MacOS, Windows, Linux, or in any environment - Python is the right choice. It also applies to efficient work with other programming languages or technologies, and a large selection of frameworks and packages, mentioned above, also plays an important role here. In recent years Python also has become the most popular language to develop Machine Learning solutions - later in this article, we will take a closer look at this topic.
Python for Startups Case Study I - Humanitrack
All that Python pros for startups mentioned above are not just empty promises, and the best way to ensure you is to take a look at some of the projects we created. Firstly, let me introduce Humanitrack, a crowd-based project management tool for numerous humanity’s dilemmas. Here our mission was to deliver an MVP with a strongly limited budget. Understanding the project limitations, we decided to engage a Python developer into the project and build it using, among the other, Django REST Framework.
Python for Startups Case Study II - SportsHI
It’s another example of an app we created with financial limitations in mind. The main goal of this New York-based startup was to face the problem of ineffective training management, so we developed a solution that improved training and matches organization, and it became a communication tool for coaches and students. This app was also an excellent example that Python works well with a cross-platform framework, React Native, which is also an excellent choice for startups.
Alongside Python’s growing popularity comes its usage in many different industries, such as Fintech, Edtech, or Healthcare. And these particular branches of business are especially sensitive about data security. Is Python able to ensure that?
Successful FinTech apps are built with Python, and it’s not just another buzzword but the true statement. The simplicity of this language is the most important value in this case. With Python, it’s not only about developing an app but also to debug it quickly if needed. Python ensures high productivity so developers can fix the bugs very fast, and when it comes to financial solutions, it can be crucial. Python can also benefit from a wide range of data science libraries that are a perfect match for financial apps. Here are some examples of Python-based Fintech apps:
This German platform connects thousands of bank and financial institutions via API and allows users to operate on different accounts in one application. Python and Django provided here user-friendly functionalities and simple usage.
That’s the loan and investment platform. The main goal that stood behind the creation of this app was to give people easier access to safe and better-value loans and investments. Python provides here the complex algorithmic models.
No worries, nobody steals anything from anyone here. But the truth is that Robinhood app has lots in common with this fictional character. It gives people easy access to the stock exchange, explains it to regular users, and converts rocket science into easily understandable actions.
Education briskly deploys digital transformation and gains lots of benefits from it. And it’s another field where Python’s simplicity wins attention. Here Python is used for creating communication tools for teachers and students, like StudyBee, an advanced learning management system for Google Classroom, which we created for a Swedish startup. We betted on Python and Django again because of its scalability - over 20 thousand of students from almost 200 schools are using this app every day during their academic year.
Pretty the same reasons convinced us to use the same tech-stack at the backend in another EdTech project - Julliard School. Almost 800 students join classes at this prestigious century-old, New York University every academic year. We faced the challenge of creating the recital management tool for them, and we succeed, coping with over 700 performances throughout the year. It shouldn’t be a surprise that we developed the solution that needed to handle high students traffic, thanks to Python’s scalability.
As well as education, the healthcare industry is also growing thanks to technology development, becoming more user/patient-centered and less bureaucracy-dependent. Lots of healthcare startups are using Python, especially when it comes to taking advantages from its data science possibilities. Here are some of them:
It is an Artificial Intelligence solution that uses technology to understand how patients are responding to treatment. It means that they are not alone with their health problems when they leave the doctor’s office, but the treatment is continuous, and its effects can be checked in real-time. Its main goal is to understand why people react differently to the same disease treatment.
That’s another AI solution that fights with reactive hospitals’ operation and promotes data-driven planning system. Qventus is a tool for optimizing patient flow, which uses Machine Learning to predict future problems, like overcrowding. It helps you to plan future actions and recommends the highest-priority actions to the hospital staff.
When it comes to healthcare, education, or financial apps, data security comes to the fore. Here we are not only asking ourselves, what is Python used for, but also if it is safe language. The truth is that Python (or any other programming language) is as safe as scrupulous was the developer while writing the code. That’s why it’s so essential to hire the best software developers possible.
The programming language security depends mostly on its popularity, that’s why we can say that Python is safe, thanks to lots of frameworks and libraries that allow developers to improve the product. Django or Flask provides some built-in functionalities which protect from main types of web attacks and the community around them develop their add-ons to make apps and websites even more secured. Our django-trench is excellent proof of that. It’s an open-source library that provides multi-factor authentication for Django. Our team of 6 experienced developers spent over 700 hours working on it. Why is it so cool? It is simple to install into any Django app and provides you with two-step authentication functionality.
You’ve probably heard about Machine Learning, so we won’t focus here on developing its definition. Basically, it’s about computer program learning from experience, mainly from the data you entered before and thanks to them, it can make predictions on your future behavior. Not to look too far, here are some basic Machine Learning examples:
- Google Maps: this navigation app can use machine learning to estimate the traffic speed, analyzing anonymous data from smartphones.
- Uber: a case similar to the one above - machine learning determines the arrival time.
- Gmail, thanks to ML Google’s solutions, can detect SPAM. Maybe you also noticed Smart Compose functionality - that’s also an example of Machine Learning.
- Spotify uses Machine Learning to find songs you would like and composes personalized playlists.
Ok, I think you get my point, so let’s move on. Nowadays, not only programmists but also entrepreneurs ask themselves: what is the best programming language for machine learning? And Python is what they often come across. Let’s try to find an answer to a question why is Python so popular in machine learning.
Well, its advantages, in this case, don’t differ much from those described above in Python’s pros for web and app development part, but let’s have a short reminder. First of all - Python is a simple language; that’s why writing machine learning algorithms is not such a big deal. As a result, developing this kind of project is faster and cheaper than using other programming languages. The fact that Python is so simple makes that not only programmers can use it, but also mathematicians, and that’s another big advantage for ML projects. Python also has a wide community and lots of useful add-ons - you can also use with Machine Learning!
Here are some of the most popular Python libraries for Machine Learning. Remember that most of them are able to collaborate with other packages, so you don't need to limit yourself to use only one in your project.
This package is developed by Google with the primary goal to serve in the scientific environment, but, as the case studies prove, it fits perfectly to any business needs. It helped Airbnb to categorize almost half of billion house photos! Tensorflow Lite version is also worth mentioning because it allows us to run an interface on mobile devices and Dance Like is an excellent example of that. It analyzes the body movements through the smartphone camera and helps people learn to dance from each other.
That’s a popular library with a highly mathematical background that simplifies lots of advanced mathematical implementations. What’s more, developers who had the possibility to work with this library tend to say that it’s really intuitive and interactive.
That’s another powerful open-source data science library that you can find implemented in apps mentioned above - Google Maps and Uber. It is not directly created with Machine Learning in mind, but it provides you with a wide range of tools that can help you analyze and capture data in clear structures.
It is a solution that has gained more popularity recently. PyTorch is a package developed by Facebook that provides Tensor computation with strong GPU acceleration. It is usually implemented in applications such as natural language processing. The truth is that PyTorch has become serious competition for TensorFlow in recent months.
At Merixstudio, we have also noticed that Python language perfectly matches Machine Learning, so we decided to implement it in some of our projects. We helped to build a tool for personalized logo creation. The generator’s engine was fueled with a machine learning classifier, that is to say - a neural network created in Tensorflow.
Another project that I think can attract your attention is our hate speech detector that we created using Django and Celery. In the era of fake news, we noticed that offensive words are becoming one of the biggest problems on the internet, and we decided to develop a simple solution that made detecting examples of hate speech easier. It is a linear classifier of which work is based on thousands of tweets as an example. Thanks to it our machine learning tool can make predictions on clarifying the phrase as offensive.
I think that it’s the best response I can give for a question: what is Python used for. This technology right now is everywhere. Thanks to its scalability, simplicity, and versatility can be used for both enterprise and startup projects. It’s growing popularity is stunning, and in a couple of years, it will be a must-have to develop a product with this language.