You might have heard of the Advent of Code,
a 25-day challenge involving a programming puzzle a day, to be solved
with the language of your choice. I’ve noted the popularity of this
activity in my Twitter timeline but also in my GitHub timeline where
I’ve seen the creation of a few advent-of-code or so repositories.
AoC is largely an exercise in figuring how to write your favourite language as if were C or C++ 😁, which can be fun ... in moderation— Jenny Bryan (@JennyBryan) December 12, 2018
If I were to participate one year, I’d probably use R. Jenny Bryan’s
tweet above inspired me to try and gauge the popularity of languages
used in the Advent of Code. To do that, in this post, I shall use the
search endpoint of GitHub V3 API to identify Advent of Code 2018 repos.
Searching repositories on GitHub
Study design ;-)
GitHub’s V3 API offers a search
endpoint,
that however gives you less results than doing the same search via the
web interface, even when
using pagination right (or at least, when believing I use pagination
right!). I’m however willing to use that sub-sample as basis for my
study of language popularity. It’s actually a sub-sub-sample, since I’m
only looking at Advent of code projects published on GitHub.
In order to circumvent the sub-sub-sampling a bit, I’ll do the search in
two steps:
Searching for Advent of code 2018 in general among repos, and
extracting the language of the repos.
Searching for Advent of code 2018 for each of these languages
separately and extracting the total count of hits.
Note that I am not filtering the repos by activity, so some of them
could very well have been created for a few days only. If they are empty
though, they do not get assigned a language.
Regarding the language of repos, GitHub assigns a language to each
repository. This information can be wrong, which is e.g. mentioned in
rOpenSci’s development
guide.
Furthermore, my using this piece of information means I’m disregarding
the fact that some people actually use a mix of technologies to solve
the puzzles.
Actual queries
I first defined a function to search the API whilst respecting the rate
limiting. I even erred on the side of caution and queried very slowly.
.search