Nguyen Le Phong

Kind & Effective EngineeringPart 1 of 5

How to Review Code Kindly (and Still Catch the Bugs)

Kind review is specific review.

Monday morning, you open a pull request. You're a little proud of it: it's the tidiest code you've written in weeks. By the afternoon there's exactly one comment: "Why is this so complicated?" It might even be a fair point. The trouble is you have no idea what to change, and for the rest of the week you keep putting off the next PR.

Most of us have been on both ends of that comment. This post is about writing the other kind: reviews that catch real problems and still leave the author keen to open the next PR. We'll cover what to look at, how to word a comment and how to label it. At the end there's real data on review speed and PR size.

Review teaches more than you think

Ask a team why they review code and you'll hear "to catch bugs." In 2013, Alberto Bacchelli and Christian Bird at Microsoft Research sat in on real reviews with 17 developers across 16 product teams and sorted hundreds of comments. Finding defects was the reason people gave most often, yet defect comments turned out to be a small share of what reviews produced. Reviews also delivered knowledge transfer, team awareness and better alternative solutions (Expectations, Outcomes, and Challenges of Modern Code Review). Google's study of nine million reviewed changes found the same thing from another angle: review works as a teaching tool, and it's how newer engineers pick up the codebase and the team's norms (Sadowski et al., 2018).

So every comment teaches something, whether you mean it to or not. A new hire learns what "good" means on your team by reading your comments. The tone teaches too. When comments are specific and friendly, people open small PRs early and ask questions freely. When comments are curt or cryptic, people sit on their changes, polish in private and drop one giant PR a week so they only get judged once.

Four engineers lean over one laptop and a few notebooks, talking through a pull request at the same table.
Review goes better when everyone at the table is working on the change and nobody is hunting the author.
The loop that makes it worse

Harsh reviews make people dread opening PRs, so they batch more work into each one. Bigger PRs are harder to review well, the feedback gets vaguer and sharper at the same time, and the dread grows. The way out is to keep the same bar and explain it better.

Kind reviewers still say no. They flag problems clearly and hold the line on what matters. The difference is that the author walks away feeling they got a second pair of hands on the problem.

Spend your attention where a human is needed

A reviewer who blocks a PR over a trailing comma has the same veto as one who just found a SQL injection. Authors notice, and after a while they stop telling the two apart. Before you start reading, decide what deserves your time:

  • Correctness: does the code do what the PR says? What happens with empty input, a timeout, a retry? Is there a production path no test touches?
  • Design: does the change fit the code around it, or does it add coupling the next feature will trip over? Is there a simpler way to get the same result?
  • Readability: would a teammate who didn't write it follow it in six months? Do the names say what things are?
  • Tests: if a test fails, would it tell you what broke? Beyond the happy path, are the edge cases and failure paths covered?
  • Security: is user input validated? Could this leak data, widen permissions or allow an injection? If yes, it's a blocker.

And the things that don't need a human:

  • Formatting and lint rules. If CI can enforce it, let CI enforce it. Reviewer attention is the most expensive step in your pipeline.
  • Personal taste. "I'd have named it differently" isn't a review comment. "This name doesn't match what the rest of the billing module calls it" is.
  • Big direction debates. If you disagree with the architecture, a PR thread is a bad place to settle it. Grab 15 minutes for a design chat, then come back to the PR.
A quick filter

Before you post a comment, ask yourself: if the author did exactly this, would the code be noticeably better? If the honest answer is "a bit, maybe," skip it or mark it as a nit. If it's "yes, because...", write it and include the "because."

Same point, better landing

The same concern can get a "good catch, fixing now" or a two-day argument depending on how it's written. Google's review guide boils it down to one rule: comment on the code, never on the developer (Google Engineering Practices). A few habits make that easier:

  • Ask when you're actually unsure. "What made you pick X over Y here?" might surface context you didn't have. When you are sure, say it plainly and give the reason. A fake question reads as passive-aggressive.
  • Give the why. "Can we move this into a service?" is a request. "Can we move this into a service? In the controller it's hard to test on its own, and the nightly job will need the same logic" is a request someone can agree with.
  • Point at a direction. You don't have to write the fix (Google's guide is clear that fixing the change is the author's job), but "maybe a lookup table here?" helps far more than "this feels off."
  • Praise specific things. "Nice, this error handling covers the retry case too. Stealing it." takes ten seconds. It tells the author what to keep doing, and your critical comments get easier to hear.
  • Say "we" when it's true. "We usually keep queries in the repository layer" points to a shared rule. "You put this in the wrong place" points at a person.
Two engineers read code side by side; one points at the shared laptop while the other takes notes.
The best review comments sound like two people working on one problem.

Same point, two ways

Blunt (technically correct) Clear and kind
"This is wrong. Handle null." "This throws if user is null. Can we add a guard here, or does the caller guarantee it's set?"
"Why would you do it this way? Way too complex." "I'm having trouble following this part. Is there a simpler shape for it? I might be missing context, happy to hop on a quick call."
"This function does too much. Split it." "This function validates and saves. If we split those two, each part gets easier to test. What do you think?"
"You clearly didn't test this." "I couldn't find a test for empty input. Did you skip it on purpose, or should we add one before merging?"
"Use const, not let." "nit: const works here since it's never reassigned, and it makes the intent obvious."
"This is a security hole." "issue (blocking): this value comes from the user and goes straight into the SQL query, so it's open to injection. Can we parameterize it before merge?"
"Wrong abstraction." "question: I'm worried this abstraction makes the next feature harder (the export one, for example). Worth a 15-minute chat?"

Look at the right column again. Nothing got softer on substance: the injection is still a blocker and the null case still needs a fix. Each comment says what's wrong, why it matters and what a fix could look like.

Label every comment

Without labels, the author has to guess which comments block the merge and which are passing thoughts. Both wrong guesses hurt: they fix every nit and the PR drags on for days, or they skip the one comment that mattered.

Conventional Comments gives you a simple format: label (decoration): subject. The labels most teams need:

  • praise: something genuinely good. Use it often.
  • nitpick: (or nit:) small, taste-level stuff. The author decides.
  • suggestion: an improvement worth considering, often outside this PR's scope.
  • issue: a real problem. Add (blocking) when the PR shouldn't merge until it's fixed.
  • question: you're genuinely asking.

Google's guide uses a lighter version of the same idea: Nit:, Optional: and FYI:. Pick one convention, write it in your team's README and stick to it.

Once every blocking issue is resolved, approve with comments. Google's guide explicitly allows approving while comments are still open, as long as you trust the author to handle them or they're optional. Just say which case it is (Speed of Code Reviews). Your teammate gets unblocked and knows you trust them with the rest.

Approve with comments

Holding a PR until every nit is fixed teaches people that review is an obstacle course. If a non-blocking point really matters to you, say so: "Not blocking, but I do care about this one. Your call." Then the author has the full picture.

When you're the one being reviewed

Most writing about review culture is aimed at reviewers. Authors shape it just as much.

Start by reading each comment in the most generous way that still makes sense. A blunt one usually comes from someone typing fast between two meetings. There's almost always a plain reading if you look for it.

Reply to every comment, even when you disagree. "Done" or a ✅ on what you fixed, a short reason on what you didn't. Silence on a comment reads as "I ignored you," even if you never meant it that way.

An engineer sits at a desk reading review comments on a laptop before replying.
Take a minute before you reply. The comment is about the code, and code is something you can change.

Push back when you really disagree, and give a reason: "I see the concern. I went this way because the API returns pages of 50, and caching the whole list would eat memory. Happy to talk it through if you still feel strongly." Sometimes you're right, sometimes the reviewer is, and sometimes it's worth bringing to the whole team.

One more thing. If your PR description needs a wall of text to defend every decision, the code itself could probably be clearer: better names, a smaller change, a comment in the right spot. A good description gives context and intent. The code should carry the rest.

A 2x2 grid of review feedback: kind or unkind, vague or specific. Kind and specific is the target. KIND UNKIND VAGUE SPECIFIC Kind + Vague Feels nice, but there's nothing to act on. "Looks good overall!" Kind + Specific The target Clear, actionable, respectful. People learn, PRs merge sooner. "nit: pull this into a helper, it's easier to test alone." Unkind + Vague The worst corner. Hurts and gives no direction. "This is a mess." Unkind + Specific Useful today, but trust wears thin over time. "Obviously wrong. Use X."
Kind and specific (top right) is the target. Kind but vague feels safe and teaches nothing. Unkind but specific works in the short run and wears down trust. Unkind and vague hurts without helping anyone fix anything.

How long a PR waits, and how big it is

Two things shape a review before the reviewer reads a single line: how long the PR waits and how big it is.

Speed first. Google's guide sets one business day as the longest you should take to respond to a review request. It also says not to break your own focus for it: finish what you're doing, then review at the next natural break (Speed of Code Reviews). A PR that sits for days pushes the author onto other work, and by the time comments arrive they've lost the context. Even a quick "I'll look after lunch" helps.

Then size. Here's what the data says:

Source What they found
Google, 9 million reviewed changes (Sadowski et al., 2018) The median change is 24 lines. The median time for the whole review is under 4 hours, and small changes get first feedback in under an hour.
AMD, Chrome OS and three Microsoft projects (Rigby and Bird, as cited in the Google study) Median time to approval of roughly 15 to 20 hours. Changes at AMD and Microsoft were larger (AMD's median was 44 lines) and usually had two reviewers.
SmartBear's study of a Cisco programming team (SmartBear, a code review tool vendor) Review no more than 200 to 400 lines at a time. Reviewer performance starts dropping after about 60 minutes.

Small PRs are easier to review properly, and they're easier to write too, because you have to decide what one change actually is. If a feature really needs thousands of lines, split it into stacked PRs: a chain of small changes that each make sense on their own. Sending a 3,000-line PR and hoping someone reads all of it rarely ends well.

How review changes as the team grows

What works for three people breaks at thirty. A rough guide:

  • 1 to 5 engineers: reviews are informal and everyone knows each other, so blunt feedback usually lands fine. It's also when habits form without anyone noticing. Start labeling comments now. It costs nothing.
  • 5 to 20 engineers: this is where review culture gets made. One senior who writes clear, labeled, friendly reviews sets the example everyone else copies. Write a one-page review guide: what counts as a blocker, what counts as a nit, how fast we respond.
  • 20 to 100 engineers: reviews now cross teams whose members may never have talked, so you have to build trust on purpose. CODEOWNERS, a review rotation and a short checklist help. Bring review quality into retros now and then, next to delivery speed.
  • 100+ engineers: review is also governance. Required reviewers, review SLAs and cycle-time metrics come in. Save human attention for what only people can judge (design, domain knowledge, impact on other teams) and let tools catch everything else before the PR opens.

Try this week

  • Before your next review, decide what counts as a blocker for this PR. Everything else gets a nit: or suggestion: label.
  • Rewrite one of your own comments with the "reason plus a direction" pattern from the table.
  • Leave one specific praise: comment.
  • Approve with comments as soon as the blockers are gone.
  • If you're the author, split your next big PR in two and see how fast each half merges.

Code review is one slice of working with people every day. The next post in the series zooms out: Kind Engineering.

What did you think?

Frequently asked questions

How long should a code review take?
Respond to a review request within one business day at most; that's the limit in Google's published review guide. A PR of a few hundred lines is usually something you can review in one sitting of under an hour. If it needs much longer, the PR is probably too big to review well.
What should I look for in a code review?
Check correctness (including edge cases and failure paths), whether the design fits the code around it, whether the next person can read it, and whether the tests would catch a regression. Look hard at security wherever user input is involved. Leave formatting to your linter and CI.
How do I give code review feedback without sounding harsh?
Comment on the code, never on the person. Explain why the change matters and point toward a fix. Ask questions only when you're genuinely unsure. Labeling each comment (nit, suggestion, issue, blocking) also takes away a lot of guesswork for the author.
Should I block a pull request over style nitpicks?
No. Block for bugs, security problems and clear breaks from agreed team standards. Mark taste-level points as nits and let the author decide, then approve with comments once the blockers are fixed.
How big should a pull request be?
Small enough to review in one sitting. At Google, the median change is 24 lines. SmartBear, studying a Cisco team, recommends reviewing no more than 200 to 400 lines at a time. For big features, use a chain of small stacked PRs.