The Tests Are Passing, Why Would I Read The Diff Again?
Code review reduces defects largely because explaining code to another person exposes gaps in understanding, much as writing comments or rubber duck debugging does. Reviewers should focus less on style and gatekeeping and more on whether the code is understandable. They should ask for clarification when something takes effort to follow and make sure the answers end up in the code and comments rather than staying in the conversation. Authors should do design review first, write introductory and why-focused comments, document data structures and invariants, and back comments with assertions and tests. The post also rebuts the "self-documenting code" and "comments go stale" objections to heavy commenting.
Related posts
- On the Importance of Pull Request Discipline
Shopify Engineering mediumAdeptWell-structured pull requests make code review easier and leave a self-documenting history that speeds debugging and rollbacks. The guide walks through each part of a GitHub PR: titles that state scope and affected models, summaries that explain what changed and why, including alternatives considered, plus commit messages, comments, labels and linked issues. For commits it recommends that each one pass CI on its own, follow a logical order, keep refactors separate from business logic, fold linter and review fixes in with fixup/autosquash, and include tests with the code they cover. It also favors smaller PRs and accepts skipping the rules during emergencies, provided the history is cleaned up afterwards.
- Code Review Can Be Better
TigerBeetle mediumAdeptTigerBeetle shelved git-review, an experiment that stored code review as a single commit of inline marked comments on top of the PR branch, edited by author and reviewer and reverted once all threads were resolved. Reviewing locally with inline comments worked very well, but applying requested changes caused merge conflicts with review comments at hunk boundaries, and frequent force-pushes added friction. The mismatch between strict hash-chained history for code and the looser merging review needs pushed the tool past a small-script budget. Git's possible adoption of Gerrit-style Change-Ids may enable per-commit interdiff review, and related tools such as Fossil, git-appraise, prr and flirt are listed.
- It Takes Two to Contract
TigerBeetle mediumAdeptDesign by contract mostly reduces to types and assertions, but a real contract needs two parties: the same condition asserted at both the definition site and the call site. In TigerBeetle, paired assertions (e.g., checking a function's return value both before returning and after the call) improve readability, act as an "airlock" for local reasoning, catch drift during refactoring, and even exposed a postcondition that was missing at the definition. The bigger payoff comes when the two halves are reached by different paths, such as sender and receiver replicas checking consensus invariants with different local knowledge, hash-chained checksums, or verifying that state rebuilt from a snapshot matches state built from replaying events. The recommendation is to look for the distant code that relies on each assertion and assert it there too.
- Keeping code moving with clearer review expectations
Sourcegraph mediumAdept
Sourcegraph is experimenting with an AI agent that routes each pull request to one of three review paths: Ship (no review), Show (review after merge) or Ask (review before merge). The agent inspects the diff, surrounding code and the author's history, and application code applies explicit rules to pick a path. Familiarity requires two merged, reviewed PRs plus a relevant contribution in the past 30 days, and changes to authentication or sensitive-data exposure always require review. Early lessons: familiarity must be scoped to specific components, visible reasoning makes decisions contestable, and the bot's own comments can become interruptions. Fewer stamp requests so far says little about review quality.
- Design system annotations, part 2: Advanced methods of annotating components
GitHub Engineering mediumAdeptDesign system teams can build their own "Preset annotations": Figma annotation components that carry accessibility details not conveyed visually, in component properties, or in code. GitHub picked ten Primer components using usage data from its Primer Query tool, audit frequency, React availability and org priorities. It then mapped the missing properties by cross-referencing Primer docs, Storybook demos, Figma asset properties, team experience and audit findings. Presets help newer teams most but need ongoing maintenance as components change, and the property mapping is groundwork for automated annotation. Figma Code Connect with hidden layers (e.g. an aria-label text property on IconButton) can bypass annotations entirely, with tips on consistency, branching and visual regression testing.