MervCodes

Tech Reviews From A Programmer

Writing Better Code Reviews: Constructive Feedback

1 min read

Code review is one of the highest-leverage activities on any engineering team. Done well, it catches bugs, spreads knowledge, and raises the bar for the whole codebase. Done poorly, it breeds resentment, slows delivery, and teaches people to fear the "Request changes" button. The difference rarely comes down to technical skill — it comes down to how feedback is delivered.

This guide focuses on the human side of reviews: how to give feedback that gets acted on without bruising the person who wrote the code.

Why Constructive Feedback Matters

A pull request is not just a diff. It's someone's work, often produced under deadline pressure, with trade-offs you may not see. When you comment, you're not editing text — you're communicating with a colleague who will remember how the exchange felt long after they've forgotten the specific bug.

Teams with healthy review cultures ship faster because authors aren't afraid to open small, frequent PRs. Teams with hostile review cultures see giant, infrequent PRs because people batch their work to minimize the pain of scrutiny. The tone you set in reviews directly shapes how your team writes and ships code.

Review the Code, Not the Coder

The single most important shift is to talk about the code, not the person. Compare these two comments:

  • "Why did you do it this way? This makes no sense."
  • "I'm having trouble following the flow here — could we extract this into a named function to make the intent clearer?"

Both point at the same problem. The first attacks a decision and implies the author is careless. The second describes your own experience reading the code and proposes a fix. Use "the code" and "we" rather than "you." It's a small grammatical change that removes the accusatory edge.

Avoid loaded words: obviously, just, simply, clearly. If something were obvious, it wouldn't need a comment. These words tell the author "you should have known better," which is exactly the message you don't want to send.

Be Specific and Actionable

Vague feedback is frustrating because it transfers your unfinished thinking onto the author. "This could be cleaner" leaves them guessing. Instead, say what you'd change and why:

This function handles parsing, validation, and persistence. Splitting it into three smaller functions would make each piece testable in isolation and easier to name.

Whenever possible, show, don't just tell. A two-line code suggestion is worth a paragraph of description. Most review tools let you propose an exact change the author can accept with one click — use that feature for anything mechanical.

Explain the "Why" Behind Every Request

A request without a reason reads like an arbitrary preference. When you explain the underlying principle, you turn a single fix into a lesson that prevents the same issue next time.

  • Weak: "Don't catch the generic exception here."
  • Strong: "Catching the base exception will also swallow KeyboardInterrupt and programming errors, which makes this hard to debug in production. Catching the specific ConnectionError keeps the safety net narrow."

The second version teaches a transferable rule. Over time, reviews that explain reasoning reduce the number of comments you need to write at all, because authors internalize the principles.

Separate Blocking Issues from Suggestions

Not every comment carries the same weight. A security hole and a variable-naming nitpick should not look identical in the thread. Label the severity so the author knows what they must address versus what's optional. A simple convention works well:

  • blocking: must be fixed before merge (correctness, security, data loss)
  • suggestion: worth considering, author's call
  • nit: tiny style preference, take it or leave it
  • question: I genuinely don't understand, help me

Prefixing comments this way removes ambiguity. Without it, authors often treat every comment as mandatory and burn hours on nitpicks while the reviewer only cared about one real issue.

Lead With Questions, Not Verdicts

When you see something odd, your first assumption should be that you're missing context, not that the author made a mistake. Asking a question invites explanation and keeps you from looking foolish when there was a good reason.

Is there a reason we're reading this config on every request instead of caching it at startup? Might be a perf concern under load, but I may be missing something.

This framing does two things: it surfaces your concern, and it leaves room for the author to teach you. Sometimes the answer is "good catch, fixing it." Sometimes it's "we tried caching and it broke hot reload." Either way, you both learn.

Acknowledge Good Work

Reviews that only ever point out problems train people to dread them. When you see a clean abstraction, a thoughtful test, or a tricky edge case handled well, say so. Positive comments cost nothing and dramatically change how the rest of your feedback lands.

Nice — using a generator here keeps memory flat even for huge inputs. Didn't think of that.

Genuine praise also calibrates the author on what "good" looks like on your team, reinforcing the patterns you want to see more of.

Mind the Tone and Volume

Forty comments on one PR feels like an interrogation, even if each is reasonable. If you find yourself writing a novel, that's a signal to switch channels. Hop on a call or pair for fifteen minutes. Complex design disagreements are almost always resolved faster in conversation than in a comment thread that spans three days and twenty replies.

Also watch your response time. A PR that sits for two days blocks the author and tempts them to context-switch away. Aim to review within a few hours, even if it's just a partial pass. Fast, kind reviews beat slow, perfect ones.

Receiving Feedback Gracefully

The culture cuts both ways. As an author, assume good intent, resist defensiveness, and treat comments as gifts of attention rather than attacks. When you disagree, explain your reasoning calmly and be willing to be wrong. A reviewer who sees their feedback engaged with thoughtfully will invest more care next time. Thank people for catches — especially the ones that stung a little.

A Quick Checklist Before You Hit Submit

  • Did I review the code, not the person?
  • Is every comment specific and, where possible, accompanied by a suggestion?
  • Did I explain the "why" for each request?
  • Did I label what's blocking versus optional?
  • Did I phrase uncertainties as questions?
  • Did I acknowledge at least one thing done well?
  • Would I be comfortable receiving these exact comments myself?

That last question is the ultimate test. If a comment would make you feel small, rewrite it.

FAQ

How many comments is too many on a single PR? There's no hard number, but if you're past a dozen substantive comments, the PR is probably too large or the conversation belongs in a call. Consider whether the work should have been split into smaller PRs in the first place.

Should I approve a PR if I left nitpicks? Yes. If nothing is blocking, approve with your nits clearly marked as optional. Holding up a merge over style preferences is a fast way to frustrate your team. Trust the author to weigh small suggestions.

What if the author keeps pushing back on a real problem? Move off the thread. Async text amplifies disagreement. A short call usually resolves it, and if it doesn't, escalate to a tech lead with both viewpoints stated fairly. Document the final decision so it's not relitigated later.

How do I review code in a language or domain I don't know well? Be honest about it. Focus on what you can evaluate — readability, naming, test coverage, error handling — and frame deeper concerns as questions. You don't need to be the expert to add value; a fresh reader often spots clarity issues the expert can't see.

Is it okay to use automated tools and AI to assist reviews? Absolutely — linters, type checkers, and AI reviewers catch the mechanical issues so humans can focus on design and intent. Just remember that tone and judgment are still yours to own. A tool can flag a problem; only you can deliver the feedback like a teammate.

Constructive code review is a skill, and like any skill it improves with deliberate practice. Start with one habit — maybe labeling severity, or leading with questions — and build from there. Your future self, and everyone who opens a PR with your name on the reviewer list, will thank you.

Related Articles