Avoiding pain in the code review process
Some time ago we had a problem. People were afraid to put their code out for review. What was the problem, and how did we solve it?
No one should feel bad at work, or be fearful to share their hard work for review. But it’s how people felt.
It was a sign that something was up. But what?
I reached out to a few people who felt confident enough to speak to me, and some common themes were appearing.
Our code review process felt “brutal”
There’d be a lot of “optional” comments, but no one ever felt they were optional and felt they MUST do them
People felt like they were doing other peoples work by proxy (meaning that they had to respond to so many comments that they felt like they weren’t contributing THEIR code)
Reviews from people in other teams with whom they had never worked felt confrontational
Was this the sign of a few bad eggs? A bad employee who was more negative than most, bring people down?
Not at all, it was because we lacked a common language and understanding of how code reviews worked. Not that we were necessarily reviewing stuff incorrectly (though there was space for improvement), we just weren’t all on the same page.
We lacked a common language and understanding of how code reviews worked
So what did we do?
Essentially, we got everyone in a room and spoke to them. We’d split up the group into 4-5 people at a time and we’d get feedback from them on what parts of the code review process worked, and what didn’t.
And before we began, we always started each session with the Agile Retrospective Manifesto to help us get onto common ground, and understand that no one is leaving comments maliciously, we’re all just trying to help.
"Regardless of what we discover, we understand and truly believe that everyone did the best job they could, given what they knew at the time, their skills and abilities, the resources available, and the situation at hand."
Norm Kerth, Project Retrospectives: A Handbook for Team Review
Why do it this way?
It’s important to make people feel heard. If people don’t feel like they’re part of the process, or being heard, they won’t commit to what we’re trying to do.
The groups were randomised to ensure people from different teams mixed, so they got more familiar to with each other. Remember that one of the main problems was that cross-team reviews felt worse because people were less familiar with other peoples’ communication styles. By making them interact in an open forum, they get a feeling for how people communicated.
It’s important to make people feel heard
What did we decide?
There’s not much point in writing out all we agreed. I could list them out, but if you tried to simply copy them into your organisation they likely wouldn’t take hold.
The reason they worked was because everyone was involved. But there are some headlines;
Trust our automation tools. If you feel they are wrong, fix them
Understand that no one intends to write bad code, and people are trying their best
Remember to clarify the why of a comment, rather than just the change itself
What was the result?
The turnaround was very fast! Within a week the bad vibes had gone away. People felt more positive, less afraid to share their code, and establishing a shared understanding and feeling across all teams meant we all worked together better.
It’s been a few years since this was last run, and some of the original comments (the minor ones, anyway) are re-appearing which is a sign we might need to run these sessions again. But the fact it’s taken years for issues to arise after 50% of the people who were in those initial sessions left suggests that we really changed the engineering culture at the company.
No one should ever feel bad to come to work. Taking the time to make sure that people felt heard was, in my opinion, the key to success. Without buy-in, people won’t feel motivated to stick with these ideas.
Establishing that common ground and connecting people was also important - it humanised those faceless people leaving comments, and meant everyone understood that when comments were being left, it wasn’t because “you’re shit!” But more “I’m just trying to help you”.


