Dale Carnegie's How to Win Friends and Influence People came out in 1936, decades before anyone opened a pull request, and it still describes code review better than most engineering handbooks. In my experience, reviews go wrong more often because of how something was said than because of what the code does. These are the ideas from the book I keep coming back to, translated into review comments, PR descriptions, incident write-ups and client conversations you can reuse.
TL;DR
- Comment on the code, never the coder. Swap verdicts like "this is wrong" for what you saw, why it matters and what you would try.
- Ask real questions instead of giving orders, and label every comment (Conventional Comments:
praise,nitpick,suggestion,issue,question) so the author knows what actually blocks the merge. - Write PR descriptions and commit messages around what the reviewer needs: where to start, how it was tested, what could break.
- Don't try to win review arguments. Move long threads to a call, admit your own mistakes first, and write incident reports about systems rather than people.
- Kind is not the same as vague. A blocking issue should still be stated plainly.
Why a 1936 book still applies
The book is a set of principles about dealing with people, each illustrated with stories. Strip out the period details and it boils down to a few ideas: people defend themselves when attacked, cooperate when respected, and care most about their own goals.
A code review is exactly that situation. Someone spent days on a change, and now a colleague is pointing out its flaws in writing, with no tone of voice and often a time zone between them. A comment that would sound fine across a desk can land like a slap in a GitHub notification.
Carnegie is also clear that none of this works as a trick; he argues people spot insincerity quickly. The goal is not to manipulate a teammate into accepting your preferences but to keep the conversation about the code so the best version ships.
The principles, mapped to engineering work
The ones I find most useful, paraphrased, and where each shows up:
| Carnegie's idea, in my words | Where it shows up |
|---|---|
| Skip criticism and complaining | Review comments about code, not people |
| Appreciate people honestly and sincerely | Specific praise comments |
| Frame things around what others care about | PR descriptions, client emails |
| Be curious about people and listen well | Asking why before suggesting |
| Arguments have no winners, so sidestep them | Long review threads, style debates |
| Respect views you disagree with | Disagreeing on design choices |
| Own your mistakes early and openly | Self-review notes, reverts |
| Prefer questions to instructions | Question-style suggestions |
| Help people keep their dignity | Blameless incident write-ups |
| Notice and praise progress | Follow-up reviews on revised code |
Comment on the code, not the coder
Carnegie's very first principle is about criticism, and he treats it as one of the most damaging habits. His point is that criticism rarely changes behaviour; it makes people justify themselves. In a review that looks like the author spending their energy defending the PR instead of improving it.
The fix is not to stop pointing out problems. It is to change the subject of the sentence from you to the code, and to give enough context that the comment teaches something.
Five harsh comments, rewritten
Each pair below keeps the same technical point. Only the framing changes.
Before: This is wrong. Use a Map.
After: issue: users.find() runs inside the invoices loop, so the work grows
with users x invoices and this page will slow down as accounts grow.
Could we build a Map of users by id once, before the loop?Before: Why would you put the API key in the frontend??
After: issue (blocking): this key is hardcoded in a file that a client
component imports, so it ends up in the browser bundle. Can we move
the call into a route handler so the key stays on the server?Before: Did you even test this on mobile?
After: question: how does this look on narrow screens? On my phone the table
pushes the page sideways. Would overflow-x: auto on the wrapper be
enough, or is there a reason to keep it full width?Before: Naming is bad.
After: nitpick (non-blocking): I had to scroll up to see what data2 holds.
Something like pendingInvoices would read faster. Fine to skip.Before: We don't do it like this here.
After: suggestion: we usually put fetch logic in lib/api so components stay
presentational (see lib/api/orders.ts). Would that work here too?
If there's a reason it can't, a short comment in the code would help
the next person.Notice the pattern: what I observed, why it matters to the product or the team, and a concrete next step. "We don't do it like this here" is the worst of the five because it gives the author nothing to act on and quietly tells them they are an outsider.
Ask real questions, not disguised orders
One of the principles in the book's section on changing people without causing resentment is to prefer questions over direct instructions. People accept an idea more readily when they had a hand in reaching it, and a question allows that the author knows something you don't. Quite often they do: the "obvious" refactor was tried and broke a test you have never seen.
There is a trap here, though. A question that is really an order in disguise is worse than the order:
Disguised order: Don't you think it would be better to use a Map here?
Real question: question: is the users list ever large here? If it can
grow past a few hundred, a Map lookup might be worth it.
If it's always small, I'm happy with find().The first version has a correct answer and both people know it. The second one is genuinely open and shares the reasoning, so the author can make the call.
Real questions depend on listening first, which is Carnegie's advice about genuine interest in others. Read the PR description and linked issue before commenting. Before proposing an alternative, restate the author's aim ("so the goal is to avoid refetching on every keystroke?"), which surfaces misunderstandings cheaply. On a call, let the author walk through the change before you critique it.
Label every comment
Much review friction comes from ambiguity. Is this comment a blocker, a preference or a passing thought? If the author can't tell, they treat every comment as a demand.
Conventional Comments is a published convention that solves this with a label at the start of each comment: label (decorations): subject. The labels I use most:
praise:something done well, said specifically.nitpick:a trivial preference. Never blocks.suggestion:a proposed improvement, with the reasoning.issue:a real problem that needs addressing, ideally paired with a suggestion.question:you need information before you can judge.
The spec lists a few more (todo, thought, chore, note among them), and decorations such as (blocking) and (non-blocking) make the merge impact explicit. Check the site for the current list. The effect is very Carnegie: the author can save face on nitpicks by simply declining them, and the reviewer never has to raise their voice on an issue because the label already says it matters.
A tiny tone check for your drafts
One low-tech habit that helps: paste a batch of draft comments into a file and run a small script over it before posting. It checks for a Conventional Comments label and flags a few phrases that tend to read badly in writing. It is a nudge, not a gate: "just" is sometimes perfectly fine.
// review-lint.mjs
// Usage: node review-lint.mjs drafts.txt
import { readFileSync } from "node:fs";
// Core Conventional Comments labels, plus the optional typo, polish, quibble.
const LABELS = new Set([
"praise", "nitpick", "suggestion", "issue", "todo",
"question", "thought", "chore", "note",
"typo", "polish", "quibble",
]);
// "label: subject" or "label (decoration): subject"
const HEADER = /^(\w+)\s*(?:\(([^)]*)\))?:\s*\S/;
// ['’] matches a straight or a curly apostrophe.
const PHRASES = [
[/\bobviously\b/i, "'obviously' implies the author should already know"],
[/\b(?:just|simply)\b/i, "'just' or 'simply' makes the work sound trivial"],
[/\bwhy didn['’]?t you\b/i, "asks about the person; ask about the trade-off instead"],
[/\bdid you even\b/i, "reads as an accusation; ask what was tested instead"],
[/\byou(?:['’]re| are) wrong\b/i, "say what you see and why, not who is wrong"],
];
const file = process.argv[2];
if (!file) {
console.error("usage: node review-lint.mjs <drafts.txt>");
process.exit(2);
}
const drafts = readFileSync(file, "utf8")
.replace(/\r\n/g, "\n")
.split(/^---$/m)
.map((s) => s.trim())
.filter(Boolean);
let flagged = 0;
drafts.forEach((text, i) => {
const notes = [];
const match = text.match(HEADER);
if (!match) {
notes.push('missing label, e.g. "suggestion: ..."');
} else if (!LABELS.has(match[1].toLowerCase())) {
notes.push(`unknown label "${match[1]}"`);
}
for (const [pattern, hint] of PHRASES) {
if (pattern.test(text)) notes.push(hint);
}
if (notes.length) flagged += 1;
console.log(`#${i + 1} ${notes.length ? "review again" : "ok"}`);
for (const note of notes) console.log(` - ${note}`);
});
console.log(`${flagged} of ${drafts.length} drafts flagged`);
process.exitCode = flagged ? 1 : 0;Drafts are separated by a line containing only ---:
Why didn't you use the existing formatDate helper? This is obviously duplicated.
---
suggestion (non-blocking): could we reuse formatDate from lib/dates.ts here? It already handles the IST offset.
---
praise: moving the retry logic into its own hook makes this much easier to follow.
---
nit: just rename this to userCount.Running node review-lint.mjs drafts.txt prints:
#1 review again
- missing label, e.g. "suggestion: ..."
- 'obviously' implies the author should already know
- asks about the person; ask about the trade-off instead
#2 ok
#3 ok
#4 review again
- unknown label "nit"
- 'just' or 'simply' makes the work sound trivial
2 of 4 drafts flaggedThe convention spells the label nitpick, which is why nit is flagged. If your team prefers nit, add it to the set.
Appreciation that is specific
Carnegie's second principle is about appreciation, and he is careful to separate the honest kind from flattery. Flattery is generic and costs nothing. Appreciation names the specific thing and why it helped.
Flattery: LGTM, great work!
Appreciation: praise: splitting the upload into a hook and a presentational
component means I could review the retry logic without
reading any JSX. That's going to make the next change easy.Two habits follow from this. First, look for something real to praise in most reviews, not as a sandwich around criticism but because positive feedback tells people what to keep doing. Carnegie does advise opening with honest praise; in written reviews I keep the praise genuine and separate from blockers rather than using it as wrapping. Second, when someone addresses your comments in a second round, say so. Carnegie suggests praising every improvement, however small; in review terms, a one-line "this reads much better now" on a revised function takes seconds and changes how the next review feels.
Warning: Don't hide a blocking issue between two compliments. Authors skim for the actionable part, and a soft blocker buried in praise is how bugs get merged. Label it
issue (blocking)and keep it separate.
Write the PR for your reviewer
Framing things around what the other person cares about is the most practical idea in the book for the author side of a review. Your reviewer does not care how hard the change was. They care about understanding it quickly, knowing where the risk is, and not being blamed if it breaks.
A pull request template
Once it is on the default branch, a file at .github/pull_request_template.md pre-fills the description of new PRs opened on GitHub. The HTML comments are hidden when the description is rendered, so they work as prompts for the author.
## What and why
<!-- The problem in one sentence, then the change in one sentence. -->
Closes #
## Where to start reviewing
<!-- Name the one or two files that hold the real change.
Say what can be skimmed: renames, generated code, snapshots. -->
## How I tested it
<!-- Commands you ran, manual steps, browsers or devices you checked. -->
## Screenshots or recordings
<!-- For UI changes, before and after. Delete this section otherwise. -->
## Risks and rollback
<!-- What could break, who would notice first, and how to undo it. -->
## Questions for the reviewer
<!-- Anything you are unsure about. Asking here saves a round of comments. -->"Questions for the reviewer" is the section that does the most work. Admitting up front that you are unsure about something invites help instead of criticism, and it points the reviewer at the riskiest part of the change.
A commit message template
The same idea applies to commit messages, whose reader is often someone months from now running git blame during an incident. Save this as .gitmessage at the repository root. The first line is intentionally blank; that is where the subject goes.
# Subject above: imperative mood, about 50 characters,
# e.g. "Fix double charge when a payment is retried".
# Leave one blank line, then answer for the reader:
#
# Why: what problem does this solve, and for whom?
# What: the approach, plus anything a reviewer might find surprising.
# Tested: how you checked it (tests, manual steps, screenshots).
# Refs: ticket, incident or PR links.Then point Git at it:
git config commit.template .gitmessagePlain git commit now opens your editor with the template, and lines starting with # are stripped by default, so the prompts never reach history. This setting lives in your local .git/config, so each teammate runs it once per clone (or uses --global with an absolute path). In my testing the relative path resolved from the repository root even from a subdirectory; if yours does not, use an absolute path.
Avoid winning the argument
Carnegie gives a whole chapter to this and sums it up in one line: "The only way to get the best of an argument is to avoid it." Even if you win, the other person resents losing, and you have gained nothing.
Review threads are where this bites. A few rules I follow:
- Two rounds, then a call. If a thread has gone back and forth twice, the written format is failing. Talk for ten minutes, then summarise the decision in the thread so the history makes sense.
- Move taste to tooling. Formatting and import order belong in Prettier, ESLint or Ruff config, decided once. A linter rule ends the debate without anyone having to win it.
- Don't declare people wrong. Carnegie's advice is to respect the other person's view even when you disagree. In practice: "I see it differently, because..." plus your reason, and if it is non-blocking, "either works, your call."
- Separate preferences from problems. If you can't name a concrete cost (a bug, a performance issue, a maintenance burden), it is probably a preference. Label it
nitpickor let it go.
Admit your own mistakes fast
Carnegie argues that admitting you were wrong quickly and clearly disarms the other person, because it leaves them nothing to attack. In engineering, it also stops the team wasting time on the cause.
When I find a bug I introduced, I say so in the fix PR:
note: I introduced this off-by-one in the pagination change last week.
This fixes it and adds the test I should have written then.The same goes for reviews. If you suggested something that turned out to be worse, say "my suggestion was wrong here, the original approach was better" in the thread. Doing it first makes it easier for everyone else to admit theirs.
Blameless incident write-ups
Carnegie's idea of letting people keep their dignity after a mistake lines up closely with blameless postmortems. If an incident report names a person as the cause, the next person who makes a mistake is more likely to hide it, and the team loses the information it needs most.
The trick is to describe what the system allowed:
Blameful: The developer deployed without running the migration and broke
checkout.
Blameless: The pipeline allowed a release to go out before its database
migration had run, and the app did not check the schema version
at startup. Checkout returned errors until the migration ran.The second version points straight at two fixes (order the pipeline steps, add a startup check). The first points at a person, which fixes nothing. A minimal write-up template:
# Incident: short description of the user impact
## Summary
Two or three sentences a non-engineer can follow.
## Impact
Who was affected, for how long, and what they could not do.
## Timeline
Times in one time zone, from first signal to full recovery.
## Contributing factors
Conditions in the system and process that made this possible.
Describe roles and steps, not names.
## What went well
Alerts, runbooks or decisions that limited the damage.
## Follow-up actions
Each action with an owner and a target date.Saying no to clients
Freelance and agency work adds a harder version of the same problem: a client asks for something that would hurt the project, and you have to push back without making them feel foolish for asking.
Carnegie's advice to frame requests around what the other person wants, and to open on a friendly note, translates into a simple structure: acknowledge why they want it, explain the cost in terms of their goals, and offer choices instead of a flat no. Here is a hypothetical example of the shape:
Hi [Name],
Thanks for sending the export idea over. I can see why it matters: your
team is re-entering these orders by hand, and that time adds up.
Adding the full export this sprint would push the payments launch past
the date your campaign is planned around. Two options that keep the
launch safe:
1. Launch on schedule, then build the full export in the next sprint.
2. Add a basic CSV download of the orders table now, which is small,
and build the formatted export after launch.
Which works better for your team? Happy to talk it through on a call.
TusharNothing in it says "no". The client keeps control of the decision, sees the trade-off in their own terms, and gets something useful either way, which is Carnegie's point about letting people feel an idea is their own.
Where this advice goes wrong
Applied mechanically, some of these techniques backfire:
- Niceness that hides the problem. A security issue phrased as a gentle question can be read as optional. Kind and clear can coexist; kind and vague cannot.
- Praise as a formula. Compliments added because a template says so are exactly the flattery Carnegie warns against. Skip praise rather than fake it.
- Questions you know the answer to. As above, a disguised order erodes trust faster than a direct one.
- Saving face for the wrong person. Blameless does not mean consequence-free for repeated, deliberate shortcuts. That is a management conversation, held privately, not a review comment.
A checklist before you hit submit
- Is every comment about the code, with no "you" doing the blaming?
- Does each one have a label, and are blockers marked as blocking?
- Did I explain why, not only what?
- Are my questions real questions?
- Did I find something specific and true to appreciate?
- Would I be comfortable if this thread were read aloud in a team meeting?
Once it is a habit, none of this slows a review down. It mostly means one more sentence of context and one fewer adjective.