← Impulso Blog

The human side of code review

Find out which mistakes you need to fix in your code reviews. After all, the human side is just as important as the technical side. Learn more!

A woman and a man reviewing code on two screens – an Impulso article

Editorial translation by Impulso.

It’s worth emphasizing that thinking about the human side of code review does not mean discouraging people from doing it. Quite the opposite. In this article, I’m pointing out some problems that can arise when we review code without keeping certain factors in mind. Those factors have more to do with people than with technology.

A few principles of code review stuck with me after I worked on some teams that were great at it and others that weren’t quite as good. In any case, my goal with code review, as with many other things in life, is to go beyond the surface and give my actions some context or meaning. So here are a few lessons I’ve learned:

The main goal and why it matters

We sometimes forget this, but the main goal of a code review is to maintain code quality, which in turn makes the project better and more reliable. When you keep that purpose in mind, you and your teammates have a shared mission, which builds camaraderie and empathy!

So whenever you review someone’s code, remember that goal. It’s common for code review to turn into criticism for its own sake, but when there’s a good reason behind the criticism, it’s more likely to be well received. When you give “feedback” with only the code in mind and no empathy for the person who wrote it, though, there’s a good chance it’ll come across as unpleasant, harsh, or even aggressive, which does the team no good.

The way I see it, what matters more than code reviews and clashes of egos between programmers is how well the IT team gets along and works together. One thing I’m sure of today is that I prefer working for companies that care more about how well their employees get along than about the criticism people give in code reviews. That’s because I have a feeling (I’m almost certain, actually) that these workplaces end up delivering better products to their customers and are great places to work and grow as a person. They also make employees want to stay for years and years.

Empathy when sending the message

Empathy is what connects code review to a friendly, respectful workplace. For example, I’ve had teammates who gave such good feedback and did it with such tact that I wanted to get it every day (several times a day, even), because I could feel it helping me grow as a programmer and as a person! The kindness in their feedback rubbed off on me and set off a domino effect. I wanted to treat them with all the kindness they’d shown me. That’s priceless!

On the other hand, when empathy is missing, what usually emerges is a competitive atmosphere that’s anything but friendly and can even get aggressive. I can’t see how that benefits the team or the business, since a company’s greatest asset is its people, not its code. So if the person doing the code review isn’t thinking about their teammates before offering criticism, there’s already a mistake to address before the code review even begins.

Focusing on the problem when receiving the message

Then there’s the person on the receiving end. They need to be ready for feedback and comfortable with the idea that constructive criticism helps you grow, and that’s just as important as how the message is delivered. A warm, friendly message won’t do much good if the person on the other end takes it as a “right jab.” Making a habit of focusing on the problem rather than the person is a good way to get really good at taking criticism and turning it into a step forward.

Conclusion

I’m always asking myself questions like these:

  • Am I doing my best?
  • Am I thinking about my teammates?
  • Am I putting this the best way I can?
  • Am I considering the whole context?

That kind of self-reflection makes you more mindful of how you deliver a message and how you take it. It’s always good to be careful, and thinking about the other person is even better! These are the ingredients for a cake that might still turn out badly. But if we use the right ingredients and make it with care, there’s much less chance it’ll go wrong. I learned that from my wife.

To me, the same goes for code reviews. The ingredients are familiar and easy to find! Just get the proportions right and always throw in two cups full of empathy. That way, the cake is much less likely to come out flat or bland.

That’s it, dattebayo.

Related articles