This year’s Global Day of Coderetreat was another great success! Last Friday, we came together in our Berlin office to improve our craft as software engineers.
Software developers usually have to focus on daily work and getting things done.
❌ they like to work alone and stay within their comfort zone
❌ they skip writing tests and do not refactor
❌ they don’t think about design and over-engineer
❌ they cannot find time to experiment and learn new practices
A code retreat is a great and fun opportunity for developers to course correct.
In six 45-minute sessions, they work on implementing Conway’s Game of Life.
The Game of Life plays on an infinite, two-dimensional grid of square cells, where the interactions between each cell and its neighbors decide the fate of each cell.
The goal of each 45-minute session is not to finish the implementation. Instead, it is to write the perfect code.
The code retreat encourages Test-first Programming (a.k.a. Test-driven Development or TDD). A test-first approach solves multiple of the above problems at the same time:
✅ tests are written first (and skipping them becomes impossible)
✅ having to think about tests leads to better design
✅ refactoring is built into the Red-Green-Refactor cycle of TDD
✅ having a safety net of tests encourages experimentation
Pair Programming is another excellent practice used in the code retreat.
Pair Programming is one of the most efficient ways to exchange knowledge. And after so many years of attending the code retreat, even I have learned something new this year:
Our most junior team member contributed a creative approach to counting the neighbors of a cell that involves taking a snapshot of the area around a cell and a simple regular expression. 🤯
You are not your code
Another principle of the code retreat is that after each session, all developers have to delete their code.
Developers dislike deleting their code – especially not without version control. It is a tough pill to swallow for most first-time participants. And in the past, I caught participants red-handed trying to sneak the last session’s code into a hidden folder.
But deleting the code is super important. It allows the participants to start fresh in the next session. The output of each session is not relevant. Developers will not be judged for it. The only thing they take into the next session is experience.
Great things never came from comfort zones
As a trainer and facilitator of the code retreat, I aim to guide the participants out of their comfort zones to maximize learning.
Rotating pairs every 45 minutes certainly gets them out of their comfort zones. But some participants need a little extra nudge (surprisingly, most often, the more senior ones).
When I notice that they chose the same approach to the problem of Conway’s Game of Life session after session, I mix in some additional challenges.
Not allowing them to use arrays or loops in the following session helps the participants to come up with new strategies and solutions.
And as an employer and team lead, I am happy to see their progress over just one day.
In the first round, most first-time participants struggle with the game’s basic rules and don’t get far. However, the last round is often about finding a better solution that supports an infinite universe and is not bound to a finite two-dimensional grid.
It actually goes both ways. The code retreat is also a great way to increase employee satisfaction and long-term retention.
It was really nice today and a pleasure to pair-program with you. 🙌
I love to read things like this, especially when they come from employees who usually do not bother to share these messages with the rest of the team.
Code retreats are a fun and highly effective way of improving your or your team’s software development skills.
See you around,