How to fight about code better

Issues that come up in PR reviews aren’t simple questions of right and wrong. When we communicate that way, it leads to defensiveness, hostility, and other impediments to teamwork.

How do you criticize others’ work productively? Here’s how we do it on my team at Blissfully:

👪 Say “we” instead of “I”

An easy way to show people you’re open to their ideas is to say the words “we” and “our” when you’re talking about the code. It can set a collaborative tone when you’re criticizing work and show that you both own the code.

🥊 Don’t judge the code

It can feel good to judge code you don’t like. But you can’t pass judgment on a language or piece of code without also judging the intelligence and capability of the people involved in it.

So don’t say “this is bad code”, even if it’s your own!

🥰 Show your appreciation generously

Dismissing contributions or concerns as unimportant is a sure and easy way to make people feel disrespected.

But with a little attention, you can form the opposite habit: the first thing you say should acknowledge the other person.

🎯 Align on goals by making them clear

Miscommunications during PRs can lead to unproductive debates and flaring tempers. Many miscommunications result from incorrect assumptions about the goal of the work.

Avoid this by making goals explicit in the PR description every time.

👯‍♀️ Avoid impasses with collaboration

I’ve seen many code reviews turn unproductive as they spiraled into abstract debates about which of two possible choices is better.

Don’t argue principles. Take the opportunity to align by working together on a concrete example.

🤝 Decide together how you want to communicate

Talk with your team about how reviews should be conducted and problems you run into.

What would you like to hear in reviews more often? What’s frustrated you in the past? Ask your team and find solutions to those issues together.

This post was originally a Twitter thread as part of Ship 30 for 30.