Step 13 of 35 · People
Code review as teaching
Review is your most frequent teaching moment. Use it to pass on judgement, not to show how you would have written it.
You will review more code than anyone on the team. Each review either teaches the author something they can reuse or tells them only what to change this time.
Say why, not only what. Separate what must change from what you would merely prefer, and label the second kind. Ask a question when you do not understand a choice. For a large problem, stop typing and talk. Point out the good decision you want repeated.
The failure to avoid is becoming the gate: every change waits for you, and your comments rewrite it into your style. Spread review across the team, let others approve, and read the reviews newer engineers give. Your aim is a team that reviews well without you.
Try this week
- Reread your last ten review comments. Count how many explain a reason and how many only give an instruction.
- Mark optional suggestions with a clear prefix so authors know what they can ignore.
- Ask two other engineers to be first reviewers this week, and read their reviews.
Signs you've got it
- Changes are approved and merged while you are away.
- The same review comment does not come up twice for the same engineer.
Resources
- guideHow to write code review comments (Google Engineering Practices) (opens in a new tab)Google
- articleHow to Do Code Reviews Like a Human (Part One) (opens in a new tab)Michael Lynch
- bookCode Review (Software Engineering at Google) (opens in a new tab)Tom Manshreck and Caitlin Sadowski
- articleGood Code Reviews, Better Code Reviews (opens in a new tab)Gergely Orosz
Talks to watch
- 23 minHow to Do Code Reviews Like a Human (PyGotham 2018) (YouTube, opens in a new tab)Michael Lynch