What are some languages used most often during the weekends? Are there some languages that are inherently more ‘hobbyist’ than others?
I have attempted to answer these questions for this year’s GitHub Data Challenge. Here is my submission.
One way to answer these questions is to survey thousands of programmers about their language use over weekdays and weekends (which might be fairly difficult, and may not be economically viable). But fortunately for us, GitHub records a swath of data from which such information can be mined. Whenever programmers push code to GitHub, or do other activities such as forking, downloading etc., information is recorded.
The data is available to be downloadable as json
files at the GitHub Archive, or as a dataset at Google BigQuery. I used the latter.
One could argue that of all the type of events performed, PushEvent
s could indicate the language use better than other events (such as WatchEvents). There are definitely several limitations with this approach but nevertheless, let us stick with this metric. The results when all events are used, is shown in subsequent sections.
The high level overview of what I did is as follows: for each language, the number of pushes during the weekends is counted and is divided by the total number of pushes (for that language) to get a ratio for that language. This ratio will indicate roughly how active these programming languages have been during weekends, and so I used these ratios to rank the languages from the most weekend-oriented to the least weekend-oriented.
Results
(Here, in order to avoid too many languages, I counted only those languages which had consistently all non-zero number of events every single day.)
So Lua, D and Arduino seem to be some of the most popular languages during the weekend. Then come Common Lisp, Haskell and Clojure (what a coincidence!). Go also seems to be pretty popular during the weekends. I am not too sure what Verilog, and VHDL are doing in the middle! Coffeescript, Actionscript - yes, they make sense. I would have expected Javascript to be around the top (meaning left), but I Javascript is the most popular language (see below) and people are churning out javascript irrespective of the day. Python, Java, PHP are getting relegated to the bottom (right) - these are more for work than hobby. Matlab and R seem to be some of the least frequently used during weekends.
Next, let us rank this percentage use during weekends for the most popular languages.
To determine language popularity, here are the top-ten languages ranked, determined by counting the number of PushEvents
(the number after the language is the raw number of events counted from the dataset).
- JavaScript,8538319
- Java,5554016
- Ruby,5032303
- Python,4285711
- PHP,4183326
- C++,2645128
- C,2620992
- Shell,1330710
- C#,978429
- Perl,917207
For these languages, the weekend popularity is as follows:
Note that these ratios are not that different, so I would argue that one shouldn’t try to find out why C is before C# etc. But the overall point here is that Perl seems to be used more often during weekends than Java.
Results based on all Event Types
Why just count the PushEvents? One could as well include the WatchEvents and ForkEvents, and may be something else. To keep things simple, I did the same analysis by counting all types of events.
The results are below (again, only those languages are considered which are used everyday).
Most of the pattern followed previously still holds, except now there are a few more languages popping into the diagram.
And as before, here are top-ten languages counted by aggregating all events (note the difference between this list and the previous list. Objective-C was not there above, but is there in this list; Perl is missing from the above).
- JavaScript,17310652
- Ruby,9813411
- Java,9461813
- Python,8129598
- PHP,7678254
- C,5008085
- C++,4410267
- Objective-C,2241348
- Shell,2064431
- C#,1831029
The corresponding ranking is as follows:
The complete list (making sure there have been events for at least half of the total number of days). The results are listed as (language, percentage of events during weekends), and ordered by the percentage in descending order.
- Nimrod,35.4411
- ooc,34.0698
- Vala,29.9059
- D,28.4488
- Dylan,28.041
- Lua,27.5552
- Parrot,26.6202
- Arduino,26.5816
- Common Lisp,26.4666
- F#,25.8841
- Scheme,24.95
- Verilog,24.8702
- Io,24.7242
- Haskell,24.596
- Delphi,24.5892
- Pure Data,24.5808
- Turing,24.4526
- SuperCollider,24.2344
- Dart,24.1175
- Emacs Lisp,24.0541
- Arc,23.7705
- Ada,23.5855
- Visual Basic,23.5394
- Clojure,23.4217
- Perl,23.2815
- DCPU-16 ASM,22.822
- AppleScript,22.7723
- Shell,22.7499
- Julia,22.7151
- Assembly,22.6994
- VimL,22.6768
- Elixir,22.6761
- Go,22.5093
- C,22.2897
- C#,22.084
- C++,22.0538
- Smalltalk,22.003
- HaXe,21.9992
- OpenEdge ABL,21.9477
- Gosu,21.8432
- Standard ML,21.4867
- CoffeeScript,21.4702
- Racket,21.1643
- Boo,21.0025
- Prolog,20.8579
- ActionScript,20.5464
- PHP,20.2422
- VHDL,20.0203
- JavaScript,19.9581
- Objective-C,19.9352
- Ruby,19.8123
- Python,19.5424
- Java,19.4998
- Logtalk,19.3459
- Objective-J,19.3309
- Scala,18.9675
- Rust,18.9617
- PowerShell,18.5705
- Factor,18.0105
- Coq,17.8117
- Groovy,17.3457
- Erlang,17.1946
- R,17.1551
- Kotlin,17.0534
- OCaml,16.8474
- XQuery,16.7247
- Rebol,16.4125
- Scilab,16.0884
- Matlab,15.9729
- FORTRAN,15.5981
- ASP,15.5426
- Puppet,15.4394
- AutoHotkey,15.1776
- Nemerle,14.9266
- ColdFusion,14.4573
- Eiffel,14.0177
- Apex,11.9424
- Tcl,11.0578
Workflow
Thanks to Google BigQuery, it was a breeze to extract the required information from approximately 60GB of data (of course after many days of tinkering with manually downloading data, figuring out staring at it continuously). But it wasn’t so much of a breeze to download the output so I could further process them. So I have put the csv files in the Data directory. Feel free to use them.
I used all the data on BigQuery (which started from 11th March 2012 until 8th May 2013, for a total of 424 days).
The following query lists the number of events per day per language. You can add a type='PushEvent'
if you want. The downloaded CVS files are in the data folder of the repository.
SELECT day, repository_language, COUNT(day) AS count FROM
(SELECT repository_language, UTC_USEC_TO_DAY(PARSE_UTC_USEC(created_at))/1000000/3600/24 AS day FROM githubarchive:github.timeline WHERE repository_language IS NOT NULL)
GROUP BY day, repository_language
ORDER BY day;
Conclusion and Reflections
There are indeed several limitations (see below) of this work. The goal here is to not obtain absolute truths, but to try to glean into vast amounts of data and see what it says. Are there some patterns in it, is there something in here that we don’t know? I definitely think this work tells us something about the various programming languages. And if anything, it has helped me view programming languages from a different perspective.
I started out with some other plans:
-
Compute PageRanks of the various repositories based on the repository fork graph to determine their relative importance. I was mainly interested in doing so since I think there must be a difference between the ordered list of popular repositories (in terms of the number of forks) vs the ordered list of important repositories. For example, Spoon-Knife is the second most forked repository, but its importance should be very low. Getting this graph from BigQuery was very hard and so I had to abandon it.
-
I wanted to see whether news announcements or product launches cause more people to get interested in that language, and therefore more pushes in that language. But from the limited analysis I did, I am afraid I couldn’t find anything like that (may be that tells us something?). For example, Bit.ly announced a realtime distributed message processing system called NSQ on 9th October 2012 and I saw a nice discernible spike in the number of watch events, but I couldn’t see any such trend for the push events. Hopefully I will look more closely into it in the future. Meanwhile, more comments are welcome.
Limitations
- The data is limited to only those programmers who use GitHub (gasp!).
- There are definitely many programmers who don’t use GitHub for their work. So all those repositories are not taken into account (which is probably good).
- GitHub classification of languages is not always accurate (see http://datahackermd.com/2013/language-use-on-github/#comment-798271901).
- I haven’t accounted for different timezones. While it may not be too difficult to account for it, I think its not worth the effort. Only location information of the programmers are recorded, which can be ambiguous/inaccurate.
Your comments
How would you interpret these results? What else do you think can be done? Let me know your comments!