# Programmatically extract TIOBE Index Ratings

## using tiobeindexr R package

TIOBE Index is an index (ranking) that claims to represent the popularity of programming languages. Yihui (The creator of blogdown package), recently wrote a blogpost titled “On TIOBE Index and the era of decision fatigue” and I strongly recommend you to go through that before continuing with this post.

So the Disclaimer goes like this: This post/author doesn’t believe that TIOBE Index is a fair way to measure/present popularity of programming languages and this is writtet just to teach you how to extract/get TIOBE Index programmatically using the R package tiobeindexr

tiobeindexr is an R package to extract TIOBE Index of the given month.

tiobeindexr is available on CRAN so you can install like below:

install.packages("tiobeindexr")

Once installed, it can be loaded like any other R package:

library(tiobeindexr)
## Downloading TIOBE Index Data using your Internet...

When tiobeindexr is loaded for the first time in the given session, it downloads the required data from the internet.

### Extract top 20 programming languages of the month

TIOBE Index publishes the rank of programming languages every month (monthly-refresh). We can use the function top_20() to extract the top 20 programming languages of the month (that TIOBE has published)

top_20()
##    Aug 2019 Aug 2018 Programming Language Ratings Change
## 1         1        1                 Java 16.028% -0.85%
## 2         2        2                    C 15.154% +0.19%
## 3         3        4               Python 10.020% +3.03%
## 4         4        3                  C++  6.057% -1.41%
## 5         5        6                   C#  3.842% +0.30%
## 6         6        5    Visual Basic .NET  3.695% -1.07%
## 7         7        8           JavaScript  2.258% -0.15%
## 8         8        7                  PHP  2.075% -0.85%
## 9         9       14          Objective-C  1.690% +0.33%
## 10       10        9                  SQL  1.625% -0.69%
## 11       11       15                 Ruby  1.316% +0.13%
## 12       12       13               MATLAB  1.274% -0.09%
## 13       13       44               Groovy  1.225% +1.04%
## 14       14       12 Delphi/Object Pascal  1.194% -0.18%
## 15       15       10    Assembly language  1.114% -0.30%
## 16       16       19         Visual Basic  1.025% +0.10%
## 17       17       17                   Go  0.973% -0.02%
## 18       18       11                Swift  0.890% -0.49%
## 19       19       16                 Perl  0.860% -0.31%
## 20       20       18                    R  0.822% -0.14%

### Visualising Top Changes of TIOBE Index This Month vs Previous Month

As you can see in the output of the previous section, top_20() also gives us the % change MoM (Month-over-Month) which we can use to see the top changes.

For simplicity, We’ll load the entire tidyverse package and use ggplot2’s bar-plot to visualize the changes.

library(tidyverse)

top_20() %>%
mutate(Change = as.numeric(gsub('%','',Change))) %>%
ggplot(aes(x = reorder(Programming Language,Change), y = Change,
fill = Programming Language,
label = paste0(Change, "%"))) +
geom_col(show.legend = FALSE) +
coord_flip() +
geom_text(nudge_x = 0.1) +
xlab('Programming Language') +
ggtitle('Programming Languages Change this Month') 

### Summary

Hence, we learnt how to use tiobeindexr to programmatically download TIOBE Index and visualize insights from it. And, alongisde we also learnt that TIOBE Index in fact isn’t a fair represenation of the popularity of programming languages