Popularity Ranking of Programming Languages | by Vahid Vaezian | Towards Data Science

There has never been a unanimous agreement on what the most popular programming languages are, and probably never will be. Yet we believe that there is merit in trying to come up with ways to rank the popularity of programming languages. It helps us to see the trends over time and gives us hints as to what to focus on. In the ever-changing world of technology, it is important to stay ahead of the curve.
The analysis that follows is on data from Stack Overflow (SO). The SO website is arguably the biggest and the most popular Q&A website in the developer community (“developer” in the general sense of anyone who writes code). Currently, it has about 10 million visits per day and has had 12.6 million users who were active on the website beyond simple visits (e.g. posted a question/answer or made a comment/edit). We believe that ranking programming languages based on their popularity on SO is a good estimate of their actual popularity.
We have calculated a popularity index for programming languages which is the average of three factors: Number of questions asked daily, number of daily distinct users and view count of questions. To identify a language, we consider the tags assigned to the posts. For example for JavaScript we consider the following tags:
   tags like ‘%javascript%’ or tags like ‘%jquery%’ or tags like ‘%js>%’ — tag ends with ‘js’ e.g. ‘node.js’or tags like ‘%extjs%’ — includes ‘extjs4’ and others
For daily question count, we calculate the number of questions that were asked in each day for each programming language.
To calculate the Distinct Users Count, we count the number of distinct users who asked/answered a question, posted a comment or edited a question/answer for each programming language in each day.
Every post in SO has an attribute showing how many times the post has been viewed. We normalize this number by dividing it by the number of days that the post has been visible. This gives us the Normalized View Count for that post. We then sum the view counts for each programming language for each day. Note that since the variance of the normalized view count for the recent posts is high, we do not include these posts in the calculation. As a result, this measure is two month behind the other two measures.
For further details on how the index is calculated see the GitHub repository.
Let’s now explore trends using some Line Charts. Note that you can follow along using this interactive dashboard (from the top-right choose the desired filters.)
Note: The following analysis is based on the SO data until the end of July 2020. The data behind the interactive dashboard will be updated each quarter.
Starting with the top five most popular programming languages (based on our index), if we look at the yearly data, we see that JavaScript has held the crown for the past 10 years, although Python now a close second, is catching up quickly. The other three, namely Java, SQL and HTML/CSS have been slightly declining in popularity in the past seven years.
If we look at the quarterly data, JavaScript is still at the top, although it is neck and neck with Python. The interesting part is the monthly data. June 2020 was the first time in the past 10 years that JavaScript lost its position at the top. Given the pace of growth of Python, it seems Python is going to be a top contender for some time.
Data Science has been a hot topic in recent years. In the following chart we can see that Python and R have had high growth rates in the past years. Scala has kept its popularity more or less, and Julia’s popularity has been minuscule so far. Note that to make it a fair comparison, only the data science part of Python is considered for this comparison (see the GitHub Repository for more details).
Among Relational Database Management Systems (RDBMS), MySQL is still the most popular, although its popularity has been declining. The same applies to SQL Server. On the other hand, PostgreSQL’s popularity has been constantly increasing in the past decade. There hasn’t been much change in popularity of Oracle.
Regarding Mobile development languages, we see some considerable changes. Swift was introduced in June 2014, which caused a major hit on popularity of Objective-C. A similar story happened for Kotlin and Java (mobile). In 2017 Google included Kotlin in Android Studio and Since May 2019, it is the preferred programming language for Android app developers.
To see the calculated popularity index in action over the past 10 years, click on the play button at the bottom-left of the chart below. You can also use the slider at the bottom to move to a specific time range.
Note: The chart will be updated with new data one month after the beginning of every quarter (as explained above, the ViewCount measure lags two month behind the other two measures, which causes the index to lag two month behind as well, as it is the average of the three measures).
If you have suggestions for improving the index, please let me know, either in the comments or by creating an issue in the GitHub Repository.