
Q: How do you know if a programmer is an extrovert?
A: They look at your shoes when they talk to you.
I can say that, I’m a programmer. And an introvert. 😉 But that’s not the type of conversation I want to write about.
A code review is a conversation: someone asks a question or makes an observation and someone else responds. But it turns out the mechanics of a code review also apply to other types of written feedback. In the past few weeks, I’ve participated in reviewing code, design documents, and contracts. Along the way, I’ve recognized that a few guiding principles can help you get the most benefit out of the review process.
Be Specific
I mean this both in the sense of not being vague (“This seems wrong”) but also not being general. It’s rare that code or prose is so weak it needs to be rewritten from scratch. You almost always have a solid outline and one or more things could stand improvement.
- In modern source control platforms, you can likely comment on a specific line of code.
- In Google Docs, Microsoft Word, and such, you generally highlight the text you want to comment on.
Once you’ve picked the code or text to comment on, give specific feedback.
- “This variable name is inconsistent with our usual style”
- “I find this hard to read; parentheses would make this calculation clearer”
- “This sentence lacks the serial comma that is recommended in our style guidelines”
- “This seems to contradict section 2.3 earlier in the document”
Critique the Work, Not the Author
Good review comments focus on the artifact, not the person.
Weak: “You clearly didn’t think about edge cases here.”
Better: “It’s not clear to me what happens if the input list is empty.”
The distinction matters. The first version invites defensiveness; the second invites collaboration. Remember, the goal is to improve the work, not win the argument.
Help the Author
If there is an external authority (a style guide or RFC or Wikipedia entry) that supports your argument and gives the author resources, link to it. (If no such reference exists, consider if your comment is going to improve the code or text, or just satisfy your own style bias.)
Be Responsive
Distributed teams thrive on the asynchronous nature of cloud-based feedback loops. But the feedback needs to be timely. I’ve come back to a conversation that has languished and wondered, “What was I trying to say here?” Your team may be in different time zones or on different schedules so feedback in minutes or even hours may not be practical. But if your feedback cycle is measured in weeks, you’re probably spending too much time getting back up to speed as you dig in again.
Only the OP Can Resolve a Conversation
Only the original poster knows with confidence that their concern has been addressed. If the reviewer is confused, the author can’t just rewrite it and assume it is now clear! Waiting for the reviewer to acknowledge that their concern has been addressed may be the most important contribution to the success of the review.
Weak
- Author: Would you look at this?
- Reviewer: This paragraph is hard for me to follow.
- Author: I rewrote it. (And resolves the conversation.)
The author has no way to tell if the new text is clear to the reviewer.
Better
- Author: Would you look at this?
- Reviewer: This paragraph is hard for me to follow.
- Author: How’s this?
- Reviewer: Yes, I understand. Thanks. (And resolves the conversation.)
Challenge: Do you see the bug in the Python code in the image at the top of this post?