Refactor Suggestions in Code Review

Refactor Suggestions in Code Review

Two duties keep refactor review fast: author-side legibility and reviewer-side severity labeling. The not-this-PR disposition and taste versus defect.

Review bandwidth is a limited resource for both parties to a pull request, and refactor legibility is one way both protect it. The author's duty is making structural changes legible — separate commits, flagged intent. The reviewer's duty is distinguishing what blocks the merge from what would merely be nicer, using a severity vocabulary that says which is which. Not-this-PR is a legitimate disposition, not a brush-off. And reviewing a refactor-only diff asks a different question than reviewing a feature: not is this behavior right, but did behavior change at all.

Two seats, one diff

A pull request puts two people in different relationships to the same code, and each has a distinct duty that keeps the exchange fast.

The author's duty is to make refactor work legible before a reviewer ever opens the diff. That means separate commits for structural changes rather than folding a rename into the same commit as a logic fix, and a PR description that explicitly flags any incidental cleanups included along the way. A reviewer who knows in advance which parts of the diff are structural and which are behavioral is checking specific, narrow claims — did the rename actually preserve behavior, is the new logic correct — rather than reconstructing the author's intent from an undifferentiated wall of changes.

The reviewer's duty is the mirror image: distinguishing what genuinely blocks the merge from what would merely be nicer, and saying explicitly which is which rather than leaving the author to guess how seriously to take a comment. A vague "consider refactoring this" comment forces the author to interpret tone, weigh whether ignoring it risks looking dismissive, and often over-invest in a suggestion the reviewer meant as a passing thought.

The shared interest underneath both duties is the same: review bandwidth is a limited resource for both parties at any given time, and refactor legibility — from the author's side and the reviewer's side alike — is one mechanism that protects it.

It is worth noticing how quickly this breaks down when either duty is skipped. An author who mixes a rename into a logic fix without flagging it forces the reviewer to reconstruct which lines matter, which is slower and less reliable than the reviewer simply being told. A reviewer who leaves unlabeled comments forces the author to guess at severity, which either causes them to over-invest in a passing thought or to under-invest in something the reviewer actually meant as blocking. Both failure modes cost the same scarce resource, just from different directions.

Proposing without scope-creep

A working severity vocabulary gives a suggestion an explicit weight instead of leaving that weight to be inferred. This article uses three labels: blocking (a correctness issue or something that causes lasting damage if merged as-is), non-blocking (worth doing, but the timing is the author's call), and nit (a matter of taste, explicitly fine to ignore). Labeling a comment lets it be honest about its own weight, which is exactly what a bare, unlabeled comment cannot do.

"Not this PR" deserves recognition as a legitimate disposition rather than a brush-off. When a reviewer raises something real but out of scope for the current diff, and the response is to route it to a ticket or a follow-up PR instead of inflating the current one, the suggestion was heard and judged real — it simply was not allowed to grow the diff it arrived in.

A rule of thumb for reviewer restraint follows directly: a suggestion that would substantially grow the diff — doubling its size is one illustrative threshold — belongs in a separate backlog conversation, not the review thread of someone else's bugfix. Asking a colleague to restructure an entire module inside their small bugfix PR is scope-creep regardless of how correct the underlying suggestion is — the venue is wrong even when the content is right.

LabelWhat it commits the author toWhat it commits the reviewer to
BlockingMust address before mergeExplains the correctness or lasting-damage reasoning
Non-blockingWorth doing; author decides timingDoes not hold up the merge waiting for it
NitNothing — explicitly optionalAccepts it may be ignored without discussion

Reviewing refactor-only diffs

A pull request that is purely structural asks a different question than a feature PR does. The question shifts from "is this behavior right" to "did behavior change at all" — and the main evidence for the second question is that the existing test suite, to the extent it covers the changed code, passes unchanged, exactly as it did before the diff.

Mechanical changes and semantic changes call for different reading strategies within the same review. A commit explicitly flagged as mechanical — a rename, a file move, a reformat — is verified by confirming the stated rule actually holds and spot-checking a handful of instances, not by reading every single changed line as if it might hide a judgment call. A commit that restructures logic, by contrast, genuinely needs to be read hunk by hunk, because that is where behavior could plausibly have shifted.

Tool-assisted changes earn a trust-but-verify posture rather than either blind trust or full manual re-derivation. IDE-driven renames are generally reliable, but not infallible at dynamic edges — a rename that needs to also update a string literal, a serialized field name, or a reflection-based lookup is exactly where an automated rename can silently miss a spot. The reviewer's spot-check should aim precisely at those edges rather than spreading evenly across the whole diff.

Disagreement between individual contributors

Distinguishing taste from defect is a point where review threads can stall out. A defect claim comes with a failure scenario attached — this input produces that wrong output, under these conditions. A taste claim comes with a preference — this reads better to me, this feels more idiomatic. Conflating the two, treating a preference as though it carries the same weight as a demonstrated failure, is where review threads go in circles without resolving.

When the disagreement really is taste, existing convention in the surrounding codebase is the tiebreaker, and it beats either party's personal style by default. Consistency with what is already there is a stronger claim than either engineer's individual preference, and if the convention itself deserves changing, that is a separate conversation from the one PR currently under review — a decision the team makes deliberately, not a side effect of one contested comment thread.

A practical rule of thumb keeps disagreements from dragging on indefinitely: a suggestion still contested after two exchanges should move out of the PR comment thread entirely — into a synchronous conversation, or into a team convention decision made outside the pressure of a specific diff waiting to merge. PR comments can be a poor medium for genuine design debate; they carry little tone, they arrive asynchronously, and they can harden positions rather than resolve them.

What review can and cannot carry

Review is a checkpoint, not the entire quality system on its own. The habits this topic describes — separating commits, scoping preparation, pinning behavior before restructuring untested code — operate before a PR is ever opened. Review verifies that those habits were followed; it does not substitute for having followed them in the first place.

A team whose entire quality bar lives inside review has, whether deliberately or not, centralized its standards into a step that is already a bottleneck. This is worth stating plainly as an observation about where load concentrates, without drifting into a prescription about how a team should structure its process — that decision belongs to the team, not to an article written for the individual contributor sitting on either side of one diff.

What review does well, and what upstream habits do not fully replace, is catching the lying name and the confusing structure that the author has grown too close to see. A fresh reader can notice things the person who wrote the code does not — not because the author was careless, but because familiarity is itself what makes certain problems invisible from the inside.

That signal is worth protecting on its own terms, separate from whatever else a given review is checking. A reviewer's first honest reaction to a name, a structure, or a flow — before they have read enough of the surrounding context to explain it away — is data the author cannot easily generate about their own code, however carefully they reread it. Preserving that first-read signal, rather than training reviewers to suppress it in the name of speed, is part of what makes the two-seat exchange worth the time it takes.

Project Inquiry