Updated at 2016-12-10 09:58
Benefits of code reviews:
- Improves software quality.
- Reduces code complexity.
- Allows questioning design decisions while avoiding outright criticizing. For example, including React to a web project mid-way development.
- Share knowledge of the code base between developers. Reviewer can ask questions about the code. This educates developers about approaches new to them.
- Increases communication between team members.
- Finds bugs before they go live.
Good guidelines when conducting code reviews:
- Code reviews can be done by anyone, regardless of their level of experience.
- Code reviews should not require you to break someone's flow, reviews should be asynchronous. Submit a pull request and continue working without expecting another developer to review it right away.
- Reviewer, author and each commenter must agree on the review outcome.
- Pick a coding style for your team and stick to it.
All changes should go through a code review. But the following can be done without a code review:
- Removing commented out code.
- Formatting indentation or white-space.
- Removing dead/unreachable code, proven by a static code analysis tool.