Code review is a systematic software quality assurance technique where developers examine each other's code changes before merging them into the main codebase. Originating from formal inspection processes in the 1970s and evolving through pair programming and modern pull request workflows, code reviews now serve as the linchpin of collaborative software development—catching bugs early, spreading knowledge across teams, and maintaining code health over time. The practice has become so fundamental that research shows teams practicing thorough code review ship 15% fewer bugs to production, yet the difference between effective and performative review often comes down to a handful of non-obvious principles: understanding when to block versus when to nitpick, how cognitive load affects defect detection rates, and why smaller PRs paradoxically receive more substantive feedback than large ones.
What This Cheat Sheet Covers
This topic spans 18 focused tables and 164 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Author Pre-Submission Checklist
| Action | Example | Description |
|---|---|---|
Read your own diff as if you're the reviewer before requesting review | • Mandatory first step—catch obvious issues, add inline comments explaining complex logic, and verify tests pass • saves reviewer time and demonstrates professionalism | |
Target 200-400 lines changed; split large features into logical increments | • Research shows defect detection drops dramatically above 400 lines • reviewers maintain focus better on smaller changes, leading to faster approvals and fewer bugs | |
What changed, why it changed, how to test; link related tickets; include screenshots for UI changes | • Context is everything—reviewers should understand the business reason and approach without reading code first • reduces back-and-forth questions | |
pre-commit run --all-files before pushing; verify linters, formatters, and tests pass | • Automation before human review—never waste reviewer time on lint errors or failing tests • use pre-commit hooks to enforce this automatically | |
Add inline PR comments explaining why you chose a specific algorithm or pattern | • Proactively address potential reviewer questions • demonstrates you've considered trade-offs and aren't blindly copying code |