logo

Code Reviews

Code reviews are an integral part of our development workflow. They ensure that the codebase remains clean, adheres to our conventions, and is thoroughly tested.

Why Code Reviews?

Quality Assurance: Before merging a Pull Request (PR), it is mandatory to get it reviewed. This process ensures the introduced changes meet our quality standards.

Knowledge Sharing: Code reviews allow team members to learn from each other, share expertise, and spread knowledge about various parts of the application.

Consistent Codebase: Adhering to a consistent style and structure makes the code more readable and maintainable by all team members.

When and How?

Trigger: Code reviews are conducted before merging a PR. No code gets merged without an approval.

Responsibility: While the primary reviewer is often the main developer of the project, peer reviews are also encouraged.

Platform: All our code reviews are facilitated through GitHub.

Objectives of Code Reviews

  1. Ensure the code follows a clean style and structure.
  2. Verify the code is open for extensions but kept as simple as possible.
  3. Ensure the functionality is well-tested and works as expected.

What to Look For?

Coding Standards: While we don't have rigid coding standards, the code should be easy for others to maintain. Following conventions is crucial.

Functionality: The feature or bug fix implemented should work as expected and be accompanied by appropriate tests.

Simplicity: The best code is not necessarily the most clever or intricate code. It should be straightforward, easy to read, and easy to maintain.

Giving Constructive Feedback

Providing feedback is an art. Here are some guidelines to ensure your feedback is constructive and helpful:

  • Be Specific: Point out specific lines or sections of code. Generalized feedback can be hard to act on.
  • Ask Questions: Instead of dictating a change, ask questions. "Why did you choose this approach?" can open a dialogue.
  • Positive First: Start with what you like about the code before diving into what could be improved.
  • Avoid Negative Language: Use neutral language and avoid words that can be perceived as aggressive or negative.
  • Recommend Solutions: When pointing out a problem, suggest a potential solution.

Handling Disagreements

Disagreements are natural. When they arise:

  • Open a Dialogue: The goal is to understand each other's perspective.
  • Focus on the Code: Keep discussions focused on the code and not personal preferences.
  • Seek a Consensus: If an agreement cannot be reached initially, involve other team members to provide their insights and aim for a collective decision.