DEV Community

Engenheira Coelho 🐇
Engenheira Coelho 🐇

Posted on

6

6 Good practices for code review

The code review process is often carried out in software projects that have a minimum quality structure. This process consists of, after a developer finishes a task and generates a pull request (PR), another developer will analyze and indicate improvements to this code.

Thus, developers work on improving the code over time, increasing the level of code quality and avoiding possible bugs. Furthermore, contributing to the improvement of technical skills and leveling time.

6 Best Practices to run on Code Review

  1. Use positive emoticons only, i.e. 👍🏽, ✅, 🚀, 😊.

  2. Don't refactor someone else's PR without them knowing. Refactoring without informing takes away the developer's learning opportunity.

  3. Prefer to explain your suggestions with small pieces of code or links that direct the developer.

  4. Whenever possible, respond to comments in PR. Enabling the setting to send new comment alerts to your email can be a great practice.

  5. Prefer to use suggestive rather than imperative language. Another good option is to use questions; Example:

Example 1

❌ “It got bad”
✔️” It’s a great practice to use more descriptive names.
Suggestion: isFlowStateFinished”.

Example 2
❌ “None of this was good”
✔️ “It’s more interesting to use the MVC pattern. Can you
notice the associated improvements? We can talk better
about 😄”.

*Example 3 *
❌ “This one is performing poorly”
✔️ “Using find() could generate better performance in this piece
of code”.

  1. In larger or more advanced PRs, congratulate, or send a positive message, on approval of the PR. Working with development is usually not easy, encouragement from colleagues is a very positive practice. Although it may seem simple, this practice helps maintain culture and good climate.

Did you like the tips? Comment here if you use other interesting practices in code review 😄

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up