Respectful Code Reviews
Respectful and constructive feedback is the basis of a fruitful collaboration, healthy work environment, and quality product.
Why You Might Want Respectful Code Reviews
Code review helps you to improve the quality of software projects. However, negative and unclear code review comments can have unwanted consequences.
The right style of communication helps to build relationships and healthy work environments.Respectful Code Reviews help to achieve the final goal of delivering a quality product. They improve the overall health of the system and code.
Problems Respectful Code Reviews Helps to Solve
- Toxic team culture
- Knowledge Stagnation e.g. open discussions lead to knowledge sharing.
- Long feedback loops
- Poor code quality
- Finger-Pointing And Blaming ## How to Implement Respectful Code Reviews
Follow defined guidelines
Define guidelines at the project or company level. Follow style guides and coding standard documents and use them as benchmarks for reviews. These guidelines should be available to all concerned for reference.
Understand code and functionality before reviewing.
Have a clear picture of the functionality before you start a review. Read related documentation. You can even ask for a code walkthrough. Clarify doubts, if any.
Explain review comments
Wherever possible, support your comments with an explanation. Suggestions and examples help the developer to understand the comments better. If you are proposing alternative solutions, show the advantages.
Be respectful and clear
Use clear and respectful language. The development and review process aims to improve the quality of the product. Make your code the main subject of the review discussion.
Appreciate good work during code review
Recognize good work whenever you see it. Acknowledging good work boosts the morale of the developer and lays the foundation for a healthy work environment.
Try to understand the intent of feedback
As a developer, you should read the comments keeping in mind that review comments are quality checks for the code. They help to make the code and the product better.
## Common Pitfalls
- Written communication makes it hard to understand the comment's intent, especially if the developer and reviewer don't know each other.
- Comment discussion may take a longer time if comments are unclear.
- Developers are biased towards their solution and may not be receptive to review comments.