insights April 19, 2017

What Programming Languages Are Used Late at Night?

Do you program in the evening? How about late at night? I enjoy programming as a hobby and I’m a bit of a night owl, so I often code well outside working hours, sometimes past midnight. And whatever time it is, when I run into a bug I visit Stack Overflow. This means that Stack…
Avatar for David Robinson
Data Scientist (former)

Do you program in the evening? How about late at night?

I enjoy programming as a hobby and I’m a bit of a night owl, so I often code well outside working hours, sometimes past midnight. And whatever time it is, when I run into a bug I visit Stack Overflow.

This means that Stack Overflow data can give us insights into what kinds of developers program in the evening or night, and conversely what programming languages are used only during the workday. In this post, we’ll examine what tags are visited at what times a day, and also compare major cities to see how their working hours differ.

Traffic During the Day

I examined Stack Overflow visits by hour across four weeks in August 2016, among the 250 tags with the most questions. For each, we approximated the time zone based on the IP address and calculated the local time. (This isn’t a perfect process, but examination shows it generally works out in the aggregate.)

I chose August simply because it avoids most Western holidays and the typical school year, which reduces the effect of students (who may work on homework in the evenings and use a different set of technologies). I’ve also tried examining only US visits, and the results are qualitatively similar.

We start with a simple question: when in the day do people visit Stack Overflow?

Stack Overflow helps programmers do their jobs, so it’s not surprising that our traffic spikes during the workday, with the site getting at least a million visits per hour between 9 a.m. and 5 p.m. You can even see a dip at 12 p.m. when developers eat lunch.

As observed in a previous post, Stack Overflow has considerably less activity on weekends, with particularly low traffic in the morning and no dip for lunch (developers use the weekend to sleep in!). We also notice Friday is lower than the other weekdays, particularly in the afternoon and evening.

For the rest of this post, we will consider only Mondays through Thursdays to avoid differences in Friday traffic affecting the analysis.

Differences across tags

We’ve seen at what times people visit Stack Overflow questions, but is that different for programmers that use particular programming languages?

Let’s consider the daily trend of visits to four popular programming languages: C, Python, Javascript, and C#. Note that we’re normalizing to “percentage of visits” for that tag, so that larger tags can be compared with smaller ones.

We can see that the overall trend is similar across the languages: programmers of all types use Stack Overflow at their jobs, go to sleep at night, take a break for lunch, and so on. However:

  • C# programmers start and stop their day earlier, and tend to use the language less in the evenings (notice the difference in relative activity around 6-11 p.m.). This might be because C# is often used at finance and enterprise software companies, which often start earlier and have rigid schedules.
  • C programmers start the day a bit later, keep using the language in the evening, and stay up the longest. This suggests C may be particularly popular among hobbyist programmers who code during their free time (or perhaps among summer school students doing homework).
  • Python and Javascript are somewhere in between: Python and Javascript developers start and end the day a little later than C# users, and are a little less likely than C programmers to work in the evening.

If you’d like to compare your favorite languages yourself, we’ve shared an interactive app here.

What languages are used most between 9 to 5?

The above figure suggests that one of the most distinguishing features of a language is the percentage of their traffic happening during the workday, specifically from 9 a.m. to 5 p.m. local time. Of the four languages in the above graph, C# would count as the “most nine-to-five,” and C as the least.

Across the 250 most common tags, which tags had the most or least of their traffic occurring during the workday?

The technologies used predominantly during the workday include many Microsoft technologies, such as SQL Server, Excel, VBA, and Internet Explorer, as well as technologies like SVN and Oracle that are frequently used at enterprise software companies.

On the other side, many of the technologies used outside the workday include web frameworks like Firebase, Meteor, and Express, as well as graphics libraries like OpenGL and Unity. The functional language Haskell is the tag most visited outside of the workday; only half of its visits happen between 9 and 5.

You might recognize that many of these technologies mirror our earlier analysis about what technologies were used on weekdays and weekends, right down to Haskell, assembly and OpenGL leading the as “most used outside working hours/days.” It looks like both of these metrics are measuring something very similar.

Rather than looking at the most extreme, let’s compare the languages to their relative frequencies of traffic.

We can see that of the most used programming technologies on Stack Overflow (more than 100,000 visits a day), C#, SQL, SQL Server and Excel stand out as being disproportionately used from 9 to 5, while Android, iOS, Swift, Node.JS, C++, and C are more visited outside of work hours.

We can pick a few interesting technologies and visualize them as an animation.

Notice the Microsoft techologies (Excel, VBA, C#) rising in the morning first, then remaining in the “lead” during the nine-to-five hours. There’s then a shift around 5 p.m. towards C/C++, mobile technologies and especially Haskell, which stands alone in the late evening.

Which technologies are used by “morning people” or “afternoon people”?

You may have noticed in the above graphs that each of the tags had a spike in the afternoon relative to the morning. In fact, this was true of almost every tag in this dataset; they were all visited at least slightly more in the afternoon than in the morning. In some cases, the differences were larger than others.

We can calculate this as an “morning / afternoon ratio,” finding the relative traffic between 9 to 12 a.m. and dividing it by the traffic between 1 and 4 p.m. Thus, a high ratio (close to 1) means something was used about equally between the morning and the evening, while a low ratio means some developers started working on it later in the day.

We can see a correlation with the “nine-to-five” metric we’ve been examining so far. Technologies that were used primarily from 9-5 were also likely to be used by “morning people”. This makes sense to me; developers who always start their work day at 9 are more likely to finish it around 5 and not keep working into the evening.

But it’s not a perfect correlation. For example, let’s consider three technologies at extreme ends of the “morning / afternoon” ratio.

Notice that SVN and Haskell fit the story that 9-to-5 workers are generally “morning people” and vice versa; SVN is strongly shifted towards 9-to-5 and is especially high-traffic from 10 to 11, while Haskell’s traffic increases over the course of the workday then stays strong in the evening. Matplotlib shows a different trend: it has a pretty typical 9-to-5 ratio, but is used a lot more in the afternoon than the morning. Maybe Python data scientists just aren’t morning people. (I use R rather than Python, but I empathize! And R is, similarly, a more “afternoon” technology than most.)

Again, feel free to try some of other technologies in the interactive application.

By City

So far we’ve been comparing programming languages technologies. But as we saw in an earlier blog post, it’s also interesting to examine how Stack Overflow traffic differs across geographies.

In particular, let’s consider the 50 cities with the most Stack Overflow traffic (during this month). In which cities did developers tend to visit between 9 to 5, or often visit outside of work hours?

The cities that kept the strictest 9-to-5 hours were mostly in western Europe, such as London, Paris, Madrid, and Amsterdam. Many of the cities that tended to visit outside local working hours were in Eastern Asia (Quezon City, Tokyo, Seoul) or Eastern Europe (Moscow, Kiev), along with the Californian cities of Los Angeles and San Francisco. My own New York might be the “city that never sleeps,” but it’s not especially notable for programming at night, ending up right around the median both globally and in the US.

To understand this, let’s take a closer look at the cities at each extreme.

London and Paris both show large spikes of traffic during the day and drop to low levels in the evening, in a pattern is roughly comparable with (for example) the average global C# visitor.

The trends of the other two cities may have to do with remote work. Some developers in Quezon City may work for American or European companies and keep nocturnal hours to improve collaboration. Moscow may be a similar case, where developers who work with American companies start later in the day.

My final (and favorite) observation is that developers in Paris take the longest and most consistent lunch breaks. Well, if I lived in Paris, I would too.

 

Podcast logo The Stack Overflow Podcast is a weekly conversation about working in software development, learning to code, and the art and culture of computer programming.