Laptop and coding in black theme

Enhancing the Code Review Experience

Published at

Photo by Blake Connally on Unsplash

Contents

Intro

Recently, I learned some good and different perspectives on code reviews. While reviewing the code, I have identified some areas where I can make improvements. By addressing these, I aim to create a more constructive and positive environment for code review. Here are some steps I learned:

The Importance of Words and Tone — Be nice 🥰

In the context of code review, it is crucial to emphasize the importance of using positive words and a supportive tone. Being nice and considerate in code reviews helps create a positive environment, improving collaboration and motivation among the development team. By choosing our words carefully and expressing feedback in a kind and respectful manner, we can provide valuable insights and suggestions without discouraging or demotivating our fellow developers.

Some examples:

  • Could you please…
  • In my opinion,…
  • Please add a unit test for this…
  • Could you please add a document for…
  • If I’m not mistaken,…

Provide specific and actionable feedback 🎬

Instead of simply pointing out mistakes, I will strive to offer clear suggestions for improvement. This will help the developer understand how to enhance their code.

Helper actionable feedback toolkit 🧰:

  • Provide code example.
  • Provide a link to a great article or document.
  • Explain the main idea behind your code suggestion.

Learning and growth 💡

Rather than dwelling on the negatives, I will view code review as an opportunity for learning and growth. I will approach it with a mindset of collaboration and knowledge sharing.

Recognize and appreciate strengths 👏

Along with pointing out areas for improvement, I will also acknowledge the strengths and positive aspects of the code. This will help create a balanced and encouraging atmosphere.

Oh, I learned this pattern from you. I didn’t know we could do this in TypeScript. Such a creative approach to solving the problem.

Open communication 💬

I will encourage open dialogue, allowing developers to ask questions and express their thoughts. This will promote better understanding and collaboration among the team.

Guideline for review

We can create a document in the GitHub wiki of the project to share these ideas and guidelines for code review. It’s a good practice to document it and ask for your teammates’ opinions.

Some actions to improve code reviews in the long term

-Pair programming 💻

  • Depending on the team and company, we could have a weekly meeting to share knowledge with our teammates.
  • Share our learning resources on company communication messengers such as Slack, Teams, and Discord.

By implementing these changes, I aim to make my code reviews more supportive and positive.