Practices
Code Review
Overview
Code reviews are essential for maintaining code quality, sharing knowledge, and fostering collaboration within our team. This guide outlines some practices for conducting effective and efficient code reviews. Happy reviewing!
Some General Guidelines
-
Be respectful and constructive
- Start with positive feedback and suggest improvements kindly.
-
Focus on the code, not the person:
- Critique the code, not the developer / writer
-
Be clear and specific:
- Provide clear, actionable feedback
- Attach reference or examples
- Put your position as someone who will receive the feedback / review
References: 10 Commandments of Egoless Programming
What to Look For / Questioned in a Code Review
Review Checklist
-
Functional correctness
-
Code Quality
- Is it readable?
- Any obvious bugs or code smells?
-
Style and Conventions
- Does it follow our standard / style guide?
- Is the naming consistent and meaningful?
-
Performance
- Is the code efficient?
- Any potential performance bottlenecks?
-
Security
- Any apparent security vulnerabilities?
Questions to ask to self when reviewing
- Is this specific code changes related to the overall intended goal of this PR or intended changes?
- Do I have any struggles understanding these changes? Will this code be maintainable in the future?
References
- Google’s Code Review Guideline https://google.github.io/eng-practices/review/
- The Standard of Code Review https://google.github.io/eng-practices/review/reviewer/standard.html
- What to Look For in a Code Review https://google.github.io/eng-practices/review/reviewer/looking-for.html