Don’t criticize my code!

Handling Conflicts during Code Reviews
Photo by jean wimmerlin on Unsplash

How we can tolerate, and handle critique will depend on many factors, for example, the tone of the feedback, or what the feedback is about. But, surely many of us have already received feedback that was well-intended and well written and still it felt like a punch in the face.

Indeed, being open and actively listening to feedback, especially when it is contradicting to our own beliefs can be hard.

Blame the Lizard Brain

One of the reasons for this is a little part of the brain called the amygdala. The amygdala is responsible for our flight or fight (and also freeze) reactions and is triggered each time when we face a threat.

This little part of our primitive brain structure was essential and crucial when we were confronted with large and dangerous animals – back in the days. You probably can’t remember 😉

Still, studies have shown during MRI scans, that the same areas of the brain get activated when we are confronted with statements that are contradicting our current beliefs.

So, during a code review, it is just natural that our amygdala reacts, when we hear contradicting suggestions.

We experience feedback differently depending on our own view

You probably experienced it yourself: if you get a request for a change in the code for something that you are neutral about (or even agree with), it is easy for you to control your emotions and to take the feedback. This kind of code review feedback feels nice, friendly and collaborative.

On the other hand. If you get a request for a change for something you are sure is correct, your immediate reaction will be to be infuriated. You might feel challenged. You might instantly think about arguments to fight for your way. Well, you just found yourself in a conflict situation. And conflicts during code reviews are one of the main code review pitfalls.

So, how are we resolving conflict?

Well, as an engineer your answer might be, of course, we just find out who is right and who is wrong. Then, the correct solution wins.

Unfortunately, even if we wish all of life would be made of zeros and ones, it’s more nuanced than that.

Often conflict has no right or wrong solution. Often it is about tradeoffs and compromises.

But, more importantly, each conflict is always about relationships. And the impact of the conflict on the relationship is at least as important as the solution itself, if not more.

How can we handle and resolve conflict in a positive way?

Well, it all starts that we have to get over the flight or fight reaction. The good thing about code reviews is that they are often asynchronous. So, you can just wait a little bit to let your brain calm down. Once your amygdala stops firing, you have more access to your rational brain.

Second, it’s important to realize and acknowledge that you are subjected to something called the backfire effect. This effect was observed and studied by researchers that investigated the neural systems involved in maintaining believes in the face of counterevidence.

What researchers found is that when people hear contradicting evidence to their current worldview, this evidence instead of rattling their beliefs can enforce their current believes.

This Oatmeal comic illustration of this phenomenon nicely.

Anyway, this effect takes place and is also linked to our friend, the amygdala. The bad news is you can not get rid of your amygdala. The good news is, giving it some time to calm down, as mentioned before, and being aware of this effect can help you get to a state of openness and willingness to learn.

The answer is not 42, it is curiosity and compassion

This brings me to point three: curiosity. Yes, curiosity is your main success factor for conflict resolution. You do not have to fear the opposing view anymore, but you can exanimate it with a curious mind.

Why does your colleague think this isn’t a good idea? What are the advantages and disadvantages of the alternative solution? And so on.

Finally, have compassion and empathy for all involved, including yourself. Take the viewpoints of all participants into account. And listen. Really try to listen. Do not listen to the goal of counter-arguing. Listen with the goal of understanding. This will lead you to the “right” solution, independent of whether you accept or reject the request for change. Leading conflicts with compassionate curiosity will help find a solution that strengthens interpersonal relationships between team members, instead of harming them.

I prepared an exclusive Code Review e-Book for my e-mail subscribers packed with code review best practices and case studies. Get the 20-page insights to code reviews now. Not a subscriber yet? Just sign-up.

Get Weekly (Reseach-based) Software Engineering Tipps

* indicates required

Dr. Michaela Greiler

I help companies improve their software development processes, like code reviewing or software testing. I work for corporations such as Microsoft, but also help smaller businesses and start-ups to ensure a productive, satisfying and efficient software engineering process.

Leave a Reply

Your email address will not be published. Required fields are marked *