Do programmers work at night or during the weekend? (2018)

Typical apartment building on a Friday night

It’s often thought that programmers have very irregular working hours compared to those of the general population. Claes, Mäntylä, Kuutila, and Adams analysed commit data from 86 large software projects and found that this isn’t actually the case – for most programmers.

Why it matters

Poor working patterns are bad for health and productivity:

It should be clear that there are plenty of reasons to avoid poor working patterns. Before we can implement measures to counteract them, we first need to know if poor working patterns are actually a common phenomenon among programmers.

How the study was conducted

The authors analysed commits in repositories from three organisations:

Only commits from larger repositories are considered, as those are more likely to be “real” projects.

What discoveries were made

As you might have already guessed, Betteridge’s law applies here – for the most part at least.

Work patterns

Commits are mostly made on business days and within regular business hours. The number of commits is a bit lower on Mondays and Fridays and a lot lower during lunch breaks and the weekend.

Having said that, there are also quite some developers that mostly make commits from noon until midnight, even during weekends.

This information is already quite useful on its own, but what’s probably even more interesting is that these numbers can be used to detect stress and overtimeIf you’re a manager there are obviously much better ways to detect this, but it’s nice to also have a way to detect these things after the fact, or from a different perspective (e.g. organisation-wide).: if more commits are made outside developers’ regular working hours, that may indicate that their workload has increased.

Differences between projects

While most projects have very similar working hours (10:00–18:00), only 60% of work is actually done during those hours.

Projects that contain many (or only) contributions from unpaid developers are especially likely to be active outside office hours, which includes hours after office hours on weekdays and hours during weekends.

Impact on commit size

Commits made during office hours have roughly the same sizeThe number of added and removed lines of code within a single commit. as commits made outside office hours.

Work patterns over time

The authors hypothesised that work patterns may change over time, for example when:

The data suggests that such projects do exist, but neither are a regular occurrence.

Impact on commit contents

The content of a commit message typically conveys the intent of the commit. This can be used to learn whether commits made outside office hours are often made for different (special) reasons.

For the Mozilla Firefox repository the authors found some small differences between commits that are made during and outside office hours. For instance, informal revert commits (which revert changes due to regression bugs) are more likely to be made by developers outside office hours.

Influence of demographics

One might assume that senior developers are more likely to work within office hours, as they’re more likely to be paid for their work.

It turns out there’s no significant correlation between seniority and amount of work done during office hours. The authors did find that work outside office hours is mostly done by unpaid developers.

The important bits

  1. Developers usually work within regular office hours (10:00–18:00)
  2. Developers that are paid for their work are more likely to make their contributions within regular office hours
  3. Work patterns extracted from commit message data can be used to detect increased workloads and/or stress levels
  4. Commits made outside office hours are slightly more likely to be quick fixes, but that’s pretty much the only real difference