Code review is having someone other than the author read a change before it is merged. It catches bugs and design problems early, spreads knowledge of the codebase, and keeps style consistent. Done well it is a conversation about the code, never about the person, and it is a skill for the reviewer as much as for the author.
Key concepts
- Small changes: a review of a few hundred lines gets real attention; a huge one gets a rubber stamp.
- What to look for: correctness, tests, design, naming, security, and whether the change does what it claims.
- Automate the rest: formatters, linters and CI handle style so humans can think about meaning.
- Tone: ask questions, explain the reason, separate "must fix" from "nit", and praise what is good.
- Author's duty: describe the why, review your own diff first, and answer comments without defensiveness.
Vocabulary
- Pull request: a proposed change, with its discussion, before it is merged.
- Nit: a minor, optional remark about style.
- LGTM: "looks good to me", an approval.
- Linter: a tool that flags suspicious or non-idiomatic code.
What to study, in order
- Review your own diff line by line before asking anyone, and note what you would flag.
- Read reviews on a well-run open source project and note how they are worded.
- Write a checklist for your language: error handling, resource cleanup, concurrency, input validation.
- Set up a formatter and a linter so the checklist shrinks.
- Practise reviewing for design: does this belong here, and will the next person understand it?