Dugnad (pronounced doog-nahd) is a Norwegian tradition of voluntary work dating back to the Vikings. The idea behind it is that a community comes together and improves their surroundings. In modern day Norway this often means fixing, cleaning and tidying communal areas.
I first heard of dugnad in a software context from a tweet by Mathias Brandewinder about the F# community:
Open source contributions as a group activity at the F# Dugnad yesterday with @dplattsf @foxyjackfox @sergeyz @Thuris @yankeefinn & Tracy, was a lot of fun :) Big thanks to @realtyshares for hosting! #fsharp
— Mathias Brandewinder (@brandewinder), December 10, 2017
I loved the idea, getting a group of devs together for a period of time with the aim of collectively improving code and the documentation surrounding it. The F# community have adopted it and run various sessions managed via their GitHub issues.
At work we have a 17 year old code base with over 8M lines of code. It’s a daunting thing to deal with and whilst we are pretty good at finding time to address specific technical debt when someone highlights it there are inevitably dark murky corners that could use some love. I decided to see if we could run a dugnad internally and tidy up some of the uglier parts of our codebase.
I had a few initial goals:
- get as many people involved as possible
- empower the less experienced members of our team to contribute
- have something tangible completed at the end of the session
- not to break anything
The team is entirely remote so we organised a call for 4 hours on a Friday afternoon. Participation was encouraged but voluntary, both to stick with the dugnad tradition and because stressing someone to wipe out 4 hours of their week if they are in the middle of something is pointless. We briefed everyone beforehand and started a chat to gather a list of ideas. We created a dugnad branch in git and asked everyone to target that with their merge requests.
We all joined the call at the start of the session and had a quick chat about what we wanted to do. Some devs had things they were keen to look at so we tried to pair them up with someone who was less sure how to get started and they dropped off the call to work together. One of our Principal Engineers and I stayed on the call for the duration of the meeting, we took turns sharing our screen and talking through the improvements we were making for anyone who was on the call to get a flavour of what we were aiming for. We encouraged anyone unsure or stuck to rejoin the call so we could help them finish their task. Throughout the 4 hours we reviewed and merged various changes. With 10 minutes remaining everyone rejoined the call and we quickly reviewed progress.
In the first session we:
- Added 132 lines of code
- Removed 17,545 lines of code
- Changed 193 files
- Merged 24 commits
Some of the code removed was unused projects that had been left to rot, others were C# project files that had been switched to the newer, leaner SDK format. I was hugely encouraged by this, we’d made significant improvements in a 4 hour window. A few devs had decided that rather than actually make changes this time around they would write tooling to weed out or fix problematic code in the next session.
We’ve now run monthly dugnad sessions for 6 months, the response from the team has been great. People often suggest tasks suitable for the call throughout the month and others turn up keen to address their current pain point. We have cleaned up commented out code, made code styles more consistent and sped up our build times by removing unnecessary dependencies. We moved huge chunks of code from .Net Framework to .Net Standard and added useful documentation. We standardised code that was similar across our services to shared modules drastically improving maintainability and have deleted code that had long since been retired.
We’ve had significant contributions from devs at all levels and have shared a wealth of knowledge by making time to address many small things that improve our code base and ultimately our products. At the beginning I really liked the idea of Dugnad but it has turned out even better than I expected and I now find myself looking forward to that 4 hour meeting each month.