principleModeratepending
Principle: Code review best practices
Viewed 0 times
code-reviewPRfeedbackblockingnitquality
Problem
Code reviews are either rubber stamps (approving without reading), nitpick-fests (bikeshedding style), or bottlenecks (reviews take days).
Solution
Effective code review practices:
For AUTHORS:
For REVIEWERS:
- Correctness: Does it work? Edge cases?
- Security: Injection, auth, data exposure?
- Architecture: Right abstraction level? Maintainable?
- Performance: O(n) issues? Missing indexes?
- Tests: Meaningful test coverage?
- LAST: Style and naming
- 'nit:' = style preference, non-blocking
- 'suggestion:' = improvement idea, non-blocking
- (no prefix) = must fix before merge
Bad: 'You should know better than to use any'
Good: 'Using a specific type here would catch bugs at compile time'
Don't block for style-only changes
For AUTHORS:
- Keep PRs small (< 400 lines changed)
- Write a clear description explaining WHY, not just WHAT
- Self-review before requesting others
- Add comments on tricky parts explaining your reasoning
- Separate refactoring from feature changes (different PRs)
For REVIEWERS:
- Focus on (in priority order):
- Correctness: Does it work? Edge cases?
- Security: Injection, auth, data exposure?
- Architecture: Right abstraction level? Maintainable?
- Performance: O(n) issues? Missing indexes?
- Tests: Meaningful test coverage?
- LAST: Style and naming
- Distinguish blocking from non-blocking feedback:
- 'nit:' = style preference, non-blocking
- 'suggestion:' = improvement idea, non-blocking
- (no prefix) = must fix before merge
- Be kind: critique code, not the person
Bad: 'You should know better than to use any'
Good: 'Using a specific type here would catch bugs at compile time'
- Respond within 24 hours (calendar, not business)
- Approve with minor comments when appropriate
Don't block for style-only changes
Why
Good code reviews catch bugs, share knowledge, and maintain quality. Bad reviews demoralize teams and slow delivery.
Revisions (0)
No revisions yet.