Do programmers work at night or during the weekend? (2018)
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:
Long working hours are correlated with depression, anxiety, and heart disease;
Atypical working hours result in more health complaints, poor work-life balance, and lower productivityCommits may be buggier when programmers are not well-rested.
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:
The Mozilla Foundation is primarily known for Firefox. Its core projects include contributions from paid developers, but the organisation also hosts projects that are developed by the community without any financial compensation.
The Apache Foundation has numerous projects and supports their communities, but doesn’t pay any of its developers. Some projects include contributions by paid developers however: many projects are business-critical to companies, which therefore sometimes choose to sponsor them or directly contribute to development.
A local company that only works on commercial, closed-source projects. Their characteristics may differ from those of open source projects from the other two 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.
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:
- a software project approaches its deadline and slowly turns into a death march in which a lot of extra work is done outside office hours;
- a project that initially has a start-up culture with flexible working hours slowly matures into a project that is largely confined to regular office hours.
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.