5

Why Python is The 1st Language

 3 years ago
source link: https://hackernoon.com/why-python-is-the-1st-language-p91g3140
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Why Python is The 1st Language

@gregorywitekGregory Witek

I manage engineers by day and help developers grow their careers by night

Some time ago I was reflecting on the (loosely defined) quality and popularity of programing languages. In the recent years we've seen a growth of appreciation for static typing, whether in form of fully-typed languages like Go, in form of JITs introduced to PHP or Ruby, or in case of Typescript, language that compiles to another dynamic language. And yet despite this trends, at the same time 2 dynamic, scripting languages marrively grew their popularity - these languages are JavaScript and Python.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

While JavaScript has had a huge advantages of having its interpreter installed on most of computers and of being the only language that could be directly executed in the browser, Python's success on the surface seems more unexpected and less obvious. In this article I'm going to try to find out and explain why Python has become much more successful than other, similar languages.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

TIOBE creates one of the most popular (hard to evaluate quality) rankings of programming languages popularity

Competitors

In a relatively short period of time, between 1987 and 1995, a few major and influential languages were created. Among them there were a couple of high-level scripting languages that gained a lot of popularity and that remain used and are developed until today:

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Python was created by Guido van Rossum, a Dutch programmer working at a research institute. Inspired by ABC, created at the institution where van Rossum worked at that time, Python was initially created in late 1980s. Driven by values like explicitness, simplicity and readability, 30 years later Python is among the most popular languages in the world and is heavily used in many areas like machine learning, academia or web development.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

PHP wasn't really meant to be a language, but rather a preprocessor which was supposed to help generating HTML more dynamically. Created in 1994 in Canada, PHP quickly gained popularity as a new, easy way to create websites that can connect to database and dynamically generate content before sending it to the user. It's been 20 years since arguably the most influential version of PHP was released (4.0). Today PHP team aims to release version 8 soon, and the language they develop, despite a lot of competition, continues to power a significant portion of websites and web applications all around the world.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Perl might not be so well known by younger readers due to a complicated history over the last 15 years, but once it was a language of hackers and programming enthusiasts. Its development started in 1987, the last major version, Perl 5,  was released in 2000, but a new one, Perl 7 (the history of Perl 6 is complicated) is just around the corner. Perl does not have a single purpose like PHP. While it has been used extensively as a backend server language, it's also used for some system tools in utilities in GNU/Linux.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Ruby is a creation of Japanese programmer, Yukihiro Matsumoto, who wanted to create a language that would be pleasant to work with. Programmer's happiness, freedom and flexibility are values that drove the development of the language. The project waas started in 1993, and in December 2020, a new major version, Ruby 3, is expected. While Ruby gained worldwide popularity thanks to a web framework, Ruby on Rails, and is often considered a web programming language, it has significant usage in other domains like server tooling and, primarily in Japan, embedded devices

0 reactions
heart.png
light.png
thumbs-down.png
money.png

JavaScript is kind of a guest in this article, as I can't say that it's clearly less popular than Python, so I will mention it here and there. Created in 1995 in USA it started as a language to be included in Netscape Navigator browser. Its goal was to add more dynamic elements to websites. It later became de facto standard for other browsers, and in early 2010s, with creation of NodeJS, it moved out of the browser to become a general purpose language. While it remains primarily used for the web, we see an increase in number of desktop applications and various utilities created in JavaScript (or one of languages compiling to JS like TypeScript).

0 reactions
heart.png
light.png
thumbs-down.png
money.png

On the photo, from the left: Rasmus Lerdorf (creator of PHP), Brendan Eich (creator of JavaScript), Guido van Rossum (creator of Python), Larry Wall (creator of Perl) and Yukihiro Matsumoto (creator of Ruby)

What made Python #1

Features?

0 reactions
heart.png
light.png
thumbs-down.png
money.png

When I think about the languages above, I can't clearly choose the best one in terms of capabilities. While Ruby has been my go to language for many years, I understand why others might prefer basically any other language from the list and they can make very valid arguments to justify their choice.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Over time all these languages became more and more similar to each other. Don't get me wrong, there are still major differences between them - different philosophies, syntaxes, different legacy issues - in the recent years they all became much closer to each other in terms of features though. So while I am sure that certain features can drive the initial interest and usage of the language (PHP made it simple to generate dynamic websites, Perl's syntax was created with linguistic principles in mind), I don't think that Python won because of having tuples, shorter syntax or enforced indentation. There must be more than that.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Corporate adoption

0 reactions
heart.png
light.png
thumbs-down.png
money.png

A strong corporate player which adopts some language in its own software and openly declares it can be a huge boost for the language popularity. Even more if the language is created by the company. The success of Java as an enterprise language is owed at least in part to marketing efforts of Sun. C# would never reach its current position if it wasn't created and promoted by Microsoft.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

While Python was created as a hobby project and not a business tool, it got some strong support in 2000s, with Google as the biggest company adopting Python. Neither of the other languages has ever received such a strong support. Even though Facebook was initially written in PHP, today it's hard to see any PHP code among their open source projects (beside Hack, their language built from PHP).

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Corporate support does not guarantee success - Dart created by Google is still actively developed, but never reached popularity of Python or even Go (another Google's language). Therefore it can't be the solely reason explaining Python's popularity over other languages, but it gave Python a big boost in 2010s and the age of data science.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Academia and first mover advantage

0 reactions
heart.png
light.png
thumbs-down.png
money.png

I'm pretty sure you know the history of QWERTY - the keyboard layout used by nearly 100% of people using Latin alphabet (with some minor modifications in various countries). QWERTY was not designed for fast typing - quite the opposite, its goal was to prevent people from typing too fast, because that blocked the typing machines, which were very common before invention of modern computers. The old limitations do not apply anymore, yet we still use the same suboptimal layout. Why? Because everyone else uses is. Because almost every keyboard in the world is designed with this layout in mind, and making people switch would require enormous effort.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

It's quite hard to change habit as an individual, and even harder as a large group of individuals with their own opinions. I believe this is one of the reasons behind lasting popularity of some programing languages. Let's take PHP - since early 2000s it's been supported by basically any hosting provider. If you wanted to run applications in Python you had to buy VPS and install the interpreter on your own, or ask the admin to provide it for you. And PHP was already there, so why not to use it instead?

0 reactions
heart.png
light.png
thumbs-down.png
money.png

This might be a bit of a stretch, but I think a similar thing can be said about Python in academia. Yes, technically it wasn't the first language used by academic institutions, but I believe it was the first language that allowed scientists to write high-level code and provided them with large set of functions that allowed scientists to work with complex numbers and equations. While significantly slower than PHP, Python allowed everyone to quickly build prototypes which later could be moved to C or C++ if performance was the problem.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

With the rise of open source and growing number of available libraries, Python became go-to scripting language in academia and while there are other tools that might be more popular (looking at MATLAB for calculations and Java as intro to programming for students), Python's position is very strong, and any language that will try to take its position has to compete against 20+ years of work on libraries and tools written for scientists.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

The rise of the new

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Together with the two reasons above comes timing and the changes happening in software industry. In the last few years the large web frameworks started losing steam. Growing popularity of microservices and function-as-a-service, together with some benefits of using the same language for the client and the API, pushed adoption of JavaScript as the language of the web (there were more reasons for sure). Other languages which were primarily used in the webdev had to either find other niches or accept losing popularity.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

At the same time another area started gaining huge popularity - data science. Such a powerful, new discipline had a chance to open door for new players - in terms of business, technological advancement, and (among many others) programming tools. It also helped Python to establish and strengthen its position as the programming language on the verge of science and engineering.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

1+2+3 = Python the King

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Let's add these 3 points together. It's some time between 2010-2015. Python together with R and MATLAB are the programming environments used by scientists. At the same time big tech companies know that machine learning is going to grow quickly and they build tools to enable scientists and engineers to use the potential of modern computational power combined with neural networks. Google works on TensorFlow, which will become the most popular machine learning framework. What do they use? The language of the science, the language they've adopted a few years before - Python. Of course the implementation of TensorFlow is done in CUDA and C++ due to performance, but the programming interface for its users is provided in Python.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

The rest seems rather straightforward from then on: Facebook's PyTorch, a competing tool, also leverages Python. Data Science bootcamps - which appeared so suddenly and in such a number like mosquitos at the lake in a hot, sunny summer evening - teach Python. Your neighbor creating Udemy courses for beginners also teaches Python.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Since Python has existed for more than 20 years and has been used in various industries and applications, its growth thanks to data science pushed forward adoption in other areas - Django and Flask get users who came to Python for data science, but stayed for good.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Why not other languages?

Python's story seems so easy and obvious in hindsight, but there were a lot of obstacles on the way. The infamous migration from version 2 to version 3 could have been (and I guess for many people was) a disaster. Till today creators of programming languages say "we don't want to repeat Python's scenario" when explaining their decisions regarding breaking backwards compatibility. Python's packaging tools (famous "- how to install pip? first install easy_install", moving from eggs to wheels as packaging format) were behind those available in other languages. Eventually it didn't matter though, despite all these issues, Python not only maintained its position, but even gained a lot of popularity over the years.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Finally let's have a look at the other scripting languages that I have mentioned in the beginning and think and wonder about why it wasn't them that reached such popularity in recent years:

0 reactions
heart.png
light.png
thumbs-down.png
money.png

PHP

0 reactions
heart.png
light.png
thumbs-down.png
money.png

PHP actually might have reached similar level of popularity around 2002-2008, and it is still going strong when it comes to web development. However it's never been a general purpose language. While it is possible to write a PHP script that will act as a Unix system tool, the language at its core is meant to be used for server side of web applications.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

On top of that, I believe PHP has certain characteristics that make it more difficult to use by larger teams (not saying it's impossible, just more difficult) - weak typing, lack of arrays (its number-indexed arrays are actually dictionaries), inconsistency in many places like function names or order of parameters - I guess one of the reasons why Facebook created Hack was to get rid of a lot of legacy stuff in PHP.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

JavaScript

0 reactions
heart.png
light.png
thumbs-down.png
money.png

As I wrote in the introduction, I believe JS might be equally or more popular than Python, but despite its quickly growing popularity in early-to-mid 2010s it is not clearly the number 1 dynamic language. Why hasn't it dominated the entire space occupied by dynamic languages after it dominated the web? I'd say the first reason is that until a few years ago JS wasn't even a good programming language. I spent a couple of years using CoffeeScript instead, simply because it was so much more pleasant to write. It changed with the ES6 and new features introduced to the language, but that was quite late. JS now and JS in 2012 are 2 very different worlds, and years ago when NodeJS was introduced, there was a strong resistance to it. A lot of programmers didn't want JS to spread to the backend where there were many other options to choose from. On top of that, JavaScript for years was considered rather a toy, a language to add animation on the website, not something to use for large projects, so it took time to convince people (and especially backend programers) that it's stable, mature, and good enough for more advanced tasks.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Perl

0 reactions
heart.png
light.png
thumbs-down.png
money.png

I've never done any serious work in Perl, so I don't really know why it failed to keep growing in popularity. Based on my understanding of the language and its development (as well as a few hours of research on this topic), Perl in its current form (Perl 5) kond of reached its limits. It was great for scripting, but it was too hard to maintain large codebases in it. And the development of Perl 6, a version that was supposed to fix these problems and make the language clearer, took 16 years to be released and eventually in 2019 the language was renamed to Raku (and is not considered a successor of Perl 5). By then a large number of developers have already moved to other languages like Python or Ruby. Interestingly, Python also had a rocky migration, but it was eventually successful, unlike moving from Perl 5 to Perl 6.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Ruby

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Since I'm personally a fan of Ruby I might be biased here, please keep that in mind. To me Ruby and Python are very similar languages. Their philosophy is different, syntax is different, but Ruby programmer reading Python code is like a Spaniard visiting Italy - you don't understand everything, but it's enough to make it work. So I think why one became more popular than the other must have reasons beyond the language itself.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

The first reason that comes to my mind is its origin - Ruby was created in Japan and it wasn't widely known in Europe and America until 2000-2004 when first a book about Ruby was written in English and then Ruby on Rails framework was created. By then Python was already gaining popularity in academia, while Ruby was categorized as web development language in the western world. What's more, the development of Ruby used to be often discussed in Japanese, which is perfectly ok and understandable (since most of contributors were/are from Japan), and at the same time I feel it might have impacted the worldwide language adoption.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

The 2nd thing is the categorization that I mentioned above - while Ruby is a general purpose language, besides Japan it is primarily known because of Rails framework (and maybe Chef and Puppet that had their share of popularity). So while it became very popular in the age of monolith SaaS applications, when the web dev moved more to JS, there was no other niche where Ruby dominated.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

There are a few more potential reasons that come to my mind, but that's for another time.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Long Live the King - but how long?

Python's dominance among dynamic languages and its huge growth of popularity is a fact. The question remains: how long will it last? Or rather, what next major shift in programming will change the situation again? Maybe the next generation of low-code tools? What languages will we use then? Will they be even closer to English than the languages we have right now?

0 reactions
heart.png
light.png
thumbs-down.png
money.png

I have a lot of questions and few answers. I know that with the growth of computational power of our devices, with the growth of popularity of machine learning and AI, and finally with growing need for tools that will let everyone control and program the devices we use daily, we must be and we are moving towards tools of higher level. While there will certainly be space for more languages like Go or Rust in the future, they're tools for experts, not for the masses. Python and other current high level languages feel like kind of a bridge - they can be learned faster, they look similar to English, yet they still require a lot effort to build non-trivial tools. I predict that the next languages that will take over Python and JavaScript in popularity will be vastly different and will allow us to express ourselves in a more natural, human way. Who knows, maybe they will even be implemented in Python.

0 reactions
heart.png
light.png
thumbs-down.png
money.png

Credits

Previously published at https://www.notonlycode.org/why-python-has-won/

0 reactions
heart.png
light.png
thumbs-down.png
money.png
1
heart.pngheart.pngheart.pngheart.png
light.pnglight.pnglight.pnglight.png
boat.pngboat.pngboat.pngboat.png
money.pngmoney.pngmoney.pngmoney.png
Share this story
Join Hacker Noon

Create your free account to unlock your custom reading experience.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK