How to Give a Code Review That Actually Improves the Code

Most code reviews fail quietly. The pull request gets approved, the code merges, and nothing actually gets better. The reviewer leaves a few comments about spacing, the author fixes them, and the real problems sail through untouched: a confusing design, a missing edge case, a function that will be painful to change six months from now. Learning how to give a code review that improves the code means changing what you look for and how you say it. A good review catches real bugs, teaches something useful, and leaves the author glad they asked for a second pair of eyes.

Start by understanding what the change is for

Read the pull request description before you read a single line of code. A review without context is guesswork: you cannot tell whether a shortcut is a smart trade-off or a mistake if you do not know what the change is trying to achieve. Check the linked ticket or issue, read the stated goal, and look at the tests first. Tests often explain intent better than the code itself, because they show which cases the author thought about.

If the description is empty or says nothing beyond “fix stuff,” say so and ask the author to fill it in. A clear description is part of the work, not a courtesy, and a good pull request description gets reviewed faster because the reviewer stops guessing and starts thinking. When you still cannot tell what a change is supposed to do after reading the description, that is a finding in itself. Ask the author to explain it in a comment or on a short call, then review again once you understand the goal.

How to give a code review that finds real problems

The core of code review best practices is simple: spend your attention where bugs actually live. Read the diff in logical order, not file order. Follow one change at a time from the entry point through the functions it touches, and ask three questions at each step. Is this correct, including the edge cases and error paths? Is it readable to someone who has never seen this code? Does it fit the patterns the rest of the codebase already uses?

Error paths deserve most of your attention because authors test the happy path and forget the rest. Take a function that retries a failed payment. The interesting questions are what happens on the second failure, what happens when the request times out, and whether a retry can charge the customer twice. A comment like “What happens here if the list is empty?” catches more real bugs than ten comments about variable names.

Skip style comments a machine could make. If a linter can enforce the rule, let the linter enforce it, and suggest adding the rule to the project instead of leaving the same comment on every pull request. Your time is better spent on design and behavior, the things no tool can judge for you.

Reviewing AI-generated code needs extra care

More pull requests now contain code an assistant drafted, and that code needs a harder look, not a lighter one. AI-written code usually looks clean and confident, which makes it easy to approve without really reading it. Check it the same way you would check a junior developer’s first draft: verify the logic against the requirements, look for invented API calls or subtly wrong assumptions, and make sure the author can explain what the code does. A checklist for AI-assisted pull requests helps here, because the failure modes are different from hand-written code. If the author cannot explain a section, the code is not ready to merge, no matter how tidy it looks.

Comment on the code, not the person

Tone decides whether your review improves the code or just annoys the author. “This function is hard to follow” keeps the focus on the code. “You wrote confusing code” turns the same observation into a judgment of the person, and a defensive author stops listening.

Questions work better than orders. “What happens if this value is null?” invites the author to think, while “Fix this null check” invites an argument about whether the fix is needed. When you do suggest a change, show what you mean. A short code sketch in the comment, or a link to how the codebase already solves the same problem elsewhere, turns a complaint into help. Explain the why, briefly: a comment that says “this will break when the table is empty because the query returns no rows” teaches something; a comment that just says “wrong” teaches nothing.

Point out what works well, too. A short note like “This test covers the retry case nicely” tells the author which habits to repeat. Reviews that only list problems train authors to dread opening them.

Separate blocking issues from suggestions

Not every comment should block a merge, and reviewers who treat every remark as a demand create slow, resentful teams. Label your comments so the author knows what must change and what is optional. A simple habit works: start blocking comments with “Blocking:”, minor style notes with “Nit:”, and ideas with “Suggestion:”. The author then fixes the real problems first instead of guessing which of your twelve comments actually matter.

For each blocking comment, say why it blocks. “Blocking: this deletes user data without a confirmation step, and there is no way to recover it” gives the author a reason and a clear fix. “Blocking: wrong” gives them nothing to work with. If a problem has an obvious fix, write it down. The author can accept a concrete suggestion in seconds; an open-ended complaint can cost them an hour of rework.

An effective code review also knows where to stop. If a change is a matter of taste, say so and let it go. Two reasonable ways to structure the same function are both fine. Save your blocking power for bugs, security holes, broken tests, and changes that make the code genuinely harder to maintain.

Keep reviews small and fast

A 2,000-line pull request will not get a real review. Nobody reads that much new code carefully, so large changes get skimmed and approved on trust. Encourage authors to split work into small, focused pull requests, one logical change each. Small commits with clear messages help as well: commit messages that explain the why make code review faster because the reviewer can follow the story of the change instead of reconstructing it from the diff.

Speed matters on your side too. A pull request that waits three days for a review blocks the author, goes stale, and picks up merge conflicts. Aim to start a review within a working day, and timebox it: most reviews deserve 30 to 60 minutes of focused attention. If a review takes longer than that, the change is probably too big, and the honest feedback is to split it. These pull request review tips sound basic, but teams that follow them merge faster with fewer bugs.

When you want a systematic pass, work through a pull request checklist written for senior reviewers. A checklist keeps you from skipping the boring checks, like tests and error handling, when the interesting part of the change grabs your attention.

What to do when you disagree

Disagreements are normal, and how a team handles them decides whether reviews stay useful. When a comment thread passes two or three exchanges without agreement, stop typing and talk. A five-minute call resolves what twenty comments cannot, because tone and intent are clearer in conversation than in text. Bring the question back to the code: what breaks, what gets harder, what does the user see?

Agree on team standards in advance so reviews stop relitigating taste. If the team has a written style guide, a testing rule, or a naming convention, link to it instead of arguing from personal preference. If no standard exists and the question keeps coming up, write one down. One short discussion that produces a shared rule saves dozens of future arguments.

Know when to let go. If a change is not a bug, not a security issue, and not a readability problem, approve it and note your idea for later. The author owns the change, and the review exists to catch problems, not to make every line match your taste. Teams that argue every detail ship slowly and review defensively. Teams that focus on what actually matters ship better code and keep reviewing each other’s work willingly.

The next time a pull request lands in your queue, try one change from this list: read the description first, label your blocking comments, or ask one question instead of giving one order. Small shifts in how you review add up fast. For a quick routine you can reuse on every review, keep a useful code review checklist nearby and run through it before you approve.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.