Chapter 2 · Practice 1 of 6
Start with design: does this change belong here and fit the system?
Why it matters
Google's guide says the most important thing to cover in a review is the overall design of the change. A perfectly written function in the wrong place still makes the system harder to work with.
Questions to ask:
- Do the pieces of this change make sense together?
- Does this code belong in this codebase, or in a library, a shared module or another service?
- Does it fit the patterns the rest of the system uses?
- Is now a good time to add this?
Send design concerns early. If the design is wrong, line comments are wasted effort, and the author may already be building more work on top of it. Raise the big issue first, before reviewing the details.
Do
- Comment on the overall approach before line by line details when the design is in doubt
Avoid
- Leaving 30 style comments on code that will be rewritten anyway