What programming languages are used late at night?

by David Robinson

on

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.

Conclusion

This analysis of when developers visit questions on Stack Overflow shows how much we can learn from aggregating traffic data, whether that is about differences in geography or differences in programming languages. Here at Stack Overflow, we use traffic data just like this to answer questions for clients making business decisions. Visit Stack Overflow Insights to see how we can use rich data and analysis to inform your decision-making.

  • José A. Gómez

    …and PHP? :S

    • mysql sqlserver

      People only get on to SO if there is a problem. Meaning PHP users tend to have less problems? #PHPMasterRace

  • Thamaraiselvam

    Haskell programmers are night owls 😀

    • varunpant

      puts me to sleep , qickly

  • Joi Owen

    I think these graphs display more about how much difficulty a language causes developers, vs how many developers are using it. If I’m writing something and have no questions about it, I won’t be going to stackoverflow for help.

    • Ted Cassirer

      That’s why you look at the fraction of views for that specific language happens during those times, not the total amount.

      If they looked at the total amount of views Java would be way up in the lead in most categories here

    • Irreal DevonD’Tigana InLife

      It also has to do with how much a language changes over time. How often does C or Haskell programmer have to work with 6 threaded graphics engine stuff, or new dx12/Vulcan implementation and libs around that? If you do the same code for 5-10 or 20 years, there is nothing new to ask. Code is there, it doesnt change.

  • Labeeb Ibrahim

    Is there a way I could get the data. Just to play around 😉

  • Martin

    What tool are you using to render those graph and animation? Great article!

    • David Robinson

      Thanks! For most of the graphs, ggplot2 in R. For the animation, gganimate.

  • José María Martín Luque

    What do you use to display the data?

    • OmarG

      I would say the “ggplot2” library from R.

      • José María Martín Luque

        ok, thanks!

    • ggplot2 R package! and gganimagte for the gif

      • José María Martín Luque

        thanks!

  • Java is not present in the listing because it takes 12 hours to open Eclipse, 12 hours to compile, 12 hours to figure out what is null and where should be those ; and 48 hours to run the hello world.

    • An actual computer from 2017 can do that just fine. Perhaps on your 386sx you can flash EPROMs rather quickly, and Eclipse would seem very slow by comparison on that hardware.

      • jbeckh2

        Unless you are trying to run the android emulator. Then JC is correct. 🙂

    • BigJohnson

      You can always tell the weekend coders.

      Let me guess…Javascript is your favorite language.

  • Dustin Heart
  • Rohit Agarwal

    Late night programming is for serious programmers,
    Hence the spike in C makes sense

  • The fedora curve

  • weihanglo

    Nice ggplot2 graphs.

  • David Pokorny

    It had never occurred to me that programming languages might be involved in manifesting personalities, or clusters of personality traits. The notion that programming languages might fall into a “Jekyll and Hyde” Manichean bimodal distribution is novel: one for ordinary work during the day and another for supernatural work during the night. How modern. What programming languages go with eine kleine nachtmusik?

    • john zwarts

      It depends on whether the languages chosen are chosen based upon agreeing with their inherit design philosophies or simply because the employer wants to.

      I and a friend off mine often sketch rough C for “toys” and I hardly ever put that type of code into an online repository.

  • Makes me happy to see so many people code in the dark. *cough* shameless self promotion *cough*
    https://www.codeinthedark.co.uk/

  • John Hascall

    Conclusion: Nobody wants to use Microsoft’s stuff on their own time…

    • StoneCypher

      you should find out where the haskell people work

      • jbeckh2

        Haskell people don’t work.

      • zingus

        being in a postdoc doesn’t count as work

  • Rex

    What is so amazing about Ahmedabad, India ? Why was it chosen ? How many people know Ahmedabad outside India ?

    Wouldn’t bangalore or a mumbai be a better choice ?

  • Andrei Vaduva

    You are all wrong! The most used programming language late at night is Perl. Every programmer gets drunk after work and starts writing Perl 🙂

    • I think you’re referring to PHP.

      • Maxwell O’Roark

        No now you’re thinking of PCP

      • flinkflonk

        Nono, perl sounds right. If intoxicated enough you feel like a programming god and try writing in perl. That *never* happens with PHP, which is only programmed in if your boss says so nowadays. Much like java really (but, compared to PHP, java actually has a chance of at least looking like a good programming language).

        • I am much happier working in PHP than Java. Happiest working on R/Node projects though.

          • BigJohnson

            most weekend coders prefer PHP and Node.

            Real devs and computer scientists hate PHP and Node.

          • Make sure to send that message out to Netflix, New York Times, Medium, Uber, Paypal, Microsoft, etc too. By the way, you might want to check out /r/gatekeeping on reddit. Seems like you would be able to just screenshot all of your posts for some karma.

          • BigJohnson

            oh yeah…I keep forgetting real devs work at Netflix and New York Times…lol
            oh and Microsoft….HUGE into PHP

            You’re a moron

          • Microsoft is into Node. You are kinda funny though with your insecurities. Sorry you feel so threatened.

          • BigJohnson

            HAHAHAHAHAHAHAHAHHAHA

            I’m not a millennial…spare me the 3rd rate psychology.

            MS is not “into node”. The vast majority of their code is in C or .Net.

            What an idiot.

          • This might be hard for you to wrap your brain around, but a company can have different departments and choose different tools for different projects. Heck, they released a code editor written in Node. It doesn’t take a psychologist to tell you are compensating for a whole hell of a lot.

          • BigJohnson

            No shit…but its about the relative size of those projects. Their node codebase is TINY compared to C, etc.

            99% of the code my company makes isn’t Javascript but guess what…our company website has a little!!! I guess that makes us a Javascript shop!!

            HAHAHAHAHAH

            Compensating for your stupidity.

          • Damn Johnson, back at it again with those blatantly fallacious statements. I guess this is what happens when you play checkers with a pigeon, it is shits all over the board.

          • BigJohnson

            HAHAHAHAH

            This idiot thinks its false that MS’s core products use more C than Node!!

            HAHAHAHAH

            Yeah dude…Windows and Office use Node

            HAHAHAHAHAHAHAH

            You are next level dumb

          • Aslam Shareef

            Whatever language you use, seems like you hate it .. so you try to put down other languages .. that or you’re some VP or something with a pencil up there which makes THIS an awesome time killer for you 🙂

          • BigJohnson

            HAHAHAHAHAH…dumbest theory ever.

        • BigJohnson

          oh god…must be a Ruby fanboy.

          Java trolls just never get any smarter

          • flinkflonk

            Ruby fanboy? Me? You are reading much too much into my comment about java. I never said java was a bad programming language (besides, since you mention ruby, one of the best implementations of ruby is actually written in java). I just mentioned the fact that *businesses* still want java this, and PHP that. It just hasn’t much of a share in the programming-while-drunk segment. Like C++ really (what’s next, you gonna call me a LISP fanboy now?).

          • BigJohnson

            RUBY!! RUBY!!!

  • Makes sense. I don’t see many open source initiatives in Microsoft languages.

    • Thomas Andreè Lian

      .Net Core (successor of .Net) is opensource along with the language https://github.com/Microsoft/dotnet

    • Chirag

      Well these days Microsoft is all about open source .NET Core, Powershell, Roslyn(compiler). They have been aggressive in embracing open source technology recently.

    • zingus

      neither does MS, having killed codeplex…

      • Batu Wilhelm

        I’m sure you are not sure what he is talking about. These are just Microsoft’s own lately open sourced repos. lol. It is new marketing decision. None of them are for community good or entirely for helping other developers. It’s marketing strategy for them. Also 9 repo is nothing comparable to entire open source community of other languages.

        • Erick Ramirez

          You do realize Microsoft has the most open source contributions (around ~18K last year) of any large company, right?

          I mean, as an example, just look at what they’ve done with Typescript. It’s amazing.

          • Marcio Longo

            We realize, from your comment, that Microsoft’s new PR strategy is working well. As for which company makes the most _code_ open source, it’s definitely not Microsoft.

  • Are you sure you don’t count the whole Russia as Moscow? There are 11 time zones here, so…

    • yev

      Well, it does say that it is local time, so I assume people know what they are doing 😉

    • David Robinson

      I’m sure.

  • Luiz Felipe Barbosa

    It would be nice to cross reference this with the activity on github repositories.

    • ern0

      And GitHub repository activity by countries 😉

  • Ashutosh Singh

    Brilliant work. Although the conclusion couldn’t have been more obvious. Developers working with American multinational companies generally work in the company’s work hours.
    C#,Java are more used in enterprises. Haskell is more a hobby language. Python is recently being adopted more with the rise of data science and would become more and more like Java.

  • Zak Taccardi

    uhh…where’s java?

    • Florin Andrei

      Out to lunch.

    • Ganesh Krishnan

      Gone for garbage collection

    • Jonathan Wiggs

      DEAD

      • BigJohnson

        so much edge

      • Minh Tran

        You wish :p

    • Bofin Babu

      Can’t you C?

    • Evan
  • Raahul Dutta

    where is Bangalore??

  • Jonathan Bryant

    “And whatever time it is, when I run into a bug I visit Stack Overflow.”

    So based on that, much of this data shows which languages have lots of buggy code in the wild, are difficult to use well at large (LoC) scale, and/or have poor documentation. Maybe this post should be titled “Which Languages Should Cause You to Run Screaming Out of a Job Interview”?

    • BigJohnson

      That’s a pretty dumb interpretation

  • Batu Wilhelm

    Another reason might be Microsoft developers tend to search StackOverflow instead of reading documentation.

    • BigJohnson

      I’ve never seen one of my devs (PHP and Javascript) “read the documentation”.

      They live on stackoverflow

    • Jonny Lin

      I would have to disagree.

      Working in both C# and JavaScript, I use stackoverflow a lot more for JavaScript questions, and just use MSDN for C# and MS tech related questions. Their documentation is really really good

      • Nicholas DiPiazza

        yeah when they have a doc, it’s a hell of a doc.

        • Jonny Lin

          The trick is to work on tech that’s been out for more than 1 year, but less than 5 🙂

    • sacredgeometry

      Depends on the question surely. Developer documentation doesn’t solve the same problems that stack does. One is for language concerns one may be more for programming concerns e.g. architecture, style, algorithms, non standard library support etc

    • Robert Harvey

      Completely bogus, unsubstantiated observation.

  • byteminister

    What programming languages are North Koreans using ?

    • muminoff

      Brainfuck

    • noimpos

      LoL.

    • Mike Wise

      A breakdown of programming language by country and city would indeed be really interesting.

  • Aamir Fayaz

    where is Scala??

  • shubhojit roy

    In the graph of “Language visited most-least between 9-5”, cute to see internet-explorer. Seems we still have archaeologists around

  • arvindpdmn

    Terrible animation in one bar chart. Other charts are good.

    • NikiNeu

      I actually quite liked how it showed movement (rate of increase).

  • Harry Moreno

    could you elaborate on the process for generating these charts? matplotlib?

  • Oleh Prokaza

    Please note that this stats is a bit inaccurate because of corporate proxy. For example when I connect to site from Kiev (Ukraine) at 10 am – site will detect that I am from London with 8 am. I think there are about 1000 such developers in Kiev that works via London. So “hours” and “cities” charts are little incorrect.

  • Did you consider fetching local mean solar time for the reverse geocoded IPs?
    London and Paris are at same longitude, with London at UTC and Paris at UTC+1, so if you shift Paris back one hour, they don’t actually work longer. When applied to like this to global dataset, I normally get more defined and better aligned curves.

    https://commons.wikimedia.org/wiki/File:Solar_time_vs_standard_time.png

  • Don

    I apologize if this has been asked already but does the country-based analysis take into account the Japanese specific Stack Overflow site?

  • “This analysis …shows how much we can learn from aggregating traffic data…”

    There’s a _huge_ difference between “how much we can SEE”, and “how much we can LEARN”.

    You’re definitely conflating the two.

  • Ch3ck

    When have seg faults and various memory management issues to handle every step of the way. No wonder C programmers have to stay up late at night to focus. Debugging is not easy 🙂