← Back to blog

October 1, 2026 · 10 min read

The Art of Code Review: Feedback That Improves Code, Not Morale

From Mid-Level to Senior · Part 4 of 18

  • #code-review
  • #pull-requests
  • #senior-engineer
  • #engineering-practices

Picture a pull request with eleven comments on it. Nine of them are about naming, two are about formatting, and none of them say whether the change is correct. The author fixes all eleven, pushes, and gets six more. By the third round they've stopped arguing and started doing whatever the reviewer says, just to get it merged.

The code that lands is probably fine. The author, though, has learned something: that review is a gate to get through, not a conversation worth having. Do that to someone a few dozen times and they'll stop asking for your opinion at all.

In Part 3 we looked at writing pull requests that are easy to review. This is the other side of the table. How do you review someone's code so the code gets better and the person still wants to work with you next week?

What a review is actually for

Before talking about tone, it helps to agree on the job. A code review has roughly four goals, in this order:

  1. Catch problems that matter. Bugs, security holes, data that can get corrupted, a migration that locks a big table, an API contract that will be painful to change later.
  2. Spread context. After the review, at least two people understand this code. That's worth a lot the next time it breaks at 2am.
  3. Keep the codebase consistent. Not your personal taste. The team's agreed way of doing things.
  4. Teach, in both directions. The reviewer often learns as much as the author.

Notice what's missing: "make the code look like I would have written it." A lot of painful reviews come from treating that as goal number one. If the code is correct, readable and consistent with the team's conventions, the fact that you'd have used a switch instead of a map is not a review comment. It's a preference, and it can stay in your head.

Also notice what's at the bottom of the list on purpose: formatting and style. If your team argues about brace placement in reviews, the fix is a formatter and a linter in CI, not more comments. Let the machine be the bad guy for the boring stuff, so humans can spend their attention on the interesting stuff.

Say how much each comment matters

The single most useful habit I'd recommend is labelling every comment with how much it matters. Without labels, the author has to guess. Is this a "please fix before merge" or a "just a thought"? Junior engineers usually assume everything is blocking and fix it all. Confident ones assume nothing is and ignore it all. Both are reasonable guesses from an unclear comment.

A table of five comment labels, ordered from must-fix to optional. "blocking:" means this has to change before merge, for example a race condition when two requests update the same order. "question:" means the reviewer needs an answer, not necessarily a change, for example asking what happens if the payment provider times out here. "suggestion:" means worth considering but the author decides, for example extracting the retry logic into its own class. "nit:" means tiny and optional, for example a typo in a log message. "praise:" means keep doing this, for example a test that makes the edge case obvious. A bar on the left shows the scale from "must fix" at the top to "optional" at the bottom.

The exact words don't matter much. Some teams use the Conventional Comments format, some just agree on nit: and blocking: and leave it there. What matters is that the author can sort your comments in five seconds:

  • blocking: must change before merge. Use it for correctness, security, data integrity, and things that are expensive to undo later. If you have more than two or three of these, the PR probably needs a conversation, not more comments (more on that below).
  • question: you need an answer. Sometimes the answer is "good catch" and the code changes. Sometimes the answer is a reason you didn't know, and you've learned something.
  • suggestion: a real improvement, but the author's call. If they say no, let it go.
  • nit: tiny and optional. A typo, a slightly better name. The author can fix it or not, and you approve either way.
  • praise: yes, this is a label too. More on it in a moment.

A related rule: approve with comments when everything left is non-blocking. Holding a PR hostage over three nits costs the team a day and teaches the author that nits are actually blocking.

Write about the code, not the person

Most hurtful review comments aren't rude on purpose. They're just short, and short text reads colder than the writer meant it. "Why would you do it this way?" can be curious or contemptuous, and the reader has no tone of voice to tell which.

Two versions of the same review comment, side by side. On the left, marked as the comment that hurts: "Why would you do it this way? This is wrong, just use a lock." On the right, marked as the comment that helps: "blocking: if two requests update the same order at the same time, both can read status PENDING and both will charge the card. Could we use an optimistic lock here (a version column)? Happy to pair on it if useful." Four annotations point at the helpful version: says how much it matters, describes the code, explains the risk, offers a way forward.

A few habits make a big difference:

  • Describe what the code does, not what the author did. "This loop calls the database once per item" instead of "you're calling the database in a loop". Same information, and it's about the code.
  • Explain the why. "This is wrong" teaches nothing. "Two concurrent requests can both read PENDING and both charge the card" teaches the failure mode, and the author will spot it on their own next time.
  • Ask real questions. "What happens if the provider times out here?" is better than "this doesn't handle timeouts" when you're not sure. Maybe it does, three files down, and you missed it.
  • Offer a way forward. A concrete suggestion, a link to a similar piece of code in the repo, or an offer to pair.
  • Drop the loaded words. "Just", "simply", "obviously", "why didn't you". Each of them implies the author should have known better.

None of this means being vague. A soft comment that hides a real problem is worse than a blunt one. The goal is to be clear about the code and kind to the person, both at once. Those two don't compete.

And use the praise: label. Not as a sandwich trick to soften bad news, people see through that quickly. Use it when you actually see something good: a test that makes a tricky edge case obvious, a nice simplification, a clear commit message. It tells the author what to keep doing, which is just as useful as telling them what to change.

Know when to stop typing

Text is a terrible medium for disagreement. Every round trip takes hours, nobody can see the other person's face, and positions harden with each reply. After a while you're not discussing the code anymore. You're defending what you said in the last comment.

A flow chart for deciding how to handle a review comment. It starts with "You have a comment". First question: is it a disagreement about design or approach rather than a detail? If yes, go to "Talk: call or pair, 15 minutes". If no, second question: has this thread gone back and forth more than twice? If yes, go to "Talk". If no, third question: would the explanation take more than a few sentences? If yes, go to "Talk". If no, "Comment on the PR". Both "Talk" paths lead to a final box: write the outcome back on the PR so the decision is in the history.

A simple rule: if a thread has gone back and forth twice and you still don't agree, stop typing and talk. A 15-minute call or a short pairing session settles most of these. Same thing when the disagreement is about the overall approach instead of a detail. If you think the whole design is wrong, twenty inline comments are the worst possible way to say it. The author gets buried and still doesn't understand your alternative.

Two things make this work:

  • Talk early for big changes. If the PR is large or touches something sensitive, a short walkthrough with the author before you start commenting often saves a full round of review.
  • Write the result back on the PR. "Talked with Ana, we're keeping the map but adding a test for the empty case" is one line, and it means the next person running git blame doesn't see an argument with no ending.

Reviewing is how context spreads

There's a quieter reason senior engineers take review seriously: it's one of the best tools a team has for spreading knowledge. Every review is a chance for one more person to understand a part of the system.

That changes how you pick reviewers. The person who knows the code best will give the fastest, sharpest review. But if they're always the reviewer, they stay the only person who knows that code. Sometimes it's worth adding a second reviewer who doesn't know the area, explicitly to learn it. They may ask questions that seem basic. Those questions are often where the missing docs and the hidden assumptions are.

It's also worth reviewing code from people more senior than you, if you're not doing it yet. You won't catch as many bugs at first, and that's fine. You'll learn how they think, and "I don't understand why this works" is a perfectly valid review comment. If you can't follow it, the next person probably can't either.

Receiving review well

Half of the time, it's your code on the table. A few habits help here too:

  • Assume good intent. The reviewer is spending their time to make your code better. Even a badly worded comment usually has a real point inside it. Look for the point first.
  • You are not your diff. A comment on your code is not a comment on your competence. This gets easier with practice, and it gets easier faster if your team labels comments and explains the why.
  • Don't argue in the first minute. Read the comment, close the tab, come back later. A lot of comments that feel unfair at first turn out to be right.
  • Disagree with reasons. "I'd rather keep it, because the map lets us add new types without touching this class" is a good reply. Then let the reviewer decide if it's blocking.
  • Answer every comment, even with just "done". It closes the loop and saves the reviewer from checking each thread again.
  • Say thanks when a review saves you. A reviewer who caught a real bug just prevented an incident with your name on it.

What to try this week

  • Label your next five review comments with blocking:, question:, suggestion: or nit:, and see if the replies change.
  • Leave one praise: on a PR where you mean it.
  • The next time a thread passes two replies, suggest a quick call and write the outcome back on the PR.
  • If your team argues about formatting in reviews, add a formatter to CI and delete that whole category of comment.

The short version

  • Review exists to catch real problems, spread context, keep the code consistent, and teach. Not to make the code look like yours.
  • Label every comment by how much it matters. Approve with comments when nothing left is blocking.
  • Write about the code, not the person. Explain the why and offer a way forward.
  • When text stops working, talk. Then write the decision back on the PR.
  • When it's your code, look for the point inside the comment before you reply.

So far this module has been about how code moves through a team: branches, pull requests and reviews. In Part 5 we'll look at what reviewers should actually be judging: code quality beyond what a linter can check, like readability, cohesion and the technical debt you take on knowingly.

This is Part 4 of 18 in the series. The Senior Engineer Roadmap maps the whole series, with a short self-assessment and four reading orders.