CodeNewbie Community 🌱

Matt Van Itallie
Matt Van Itallie

Posted on

Five Golden Rules of Creating Code Reviews

Writing effective code reviews is a superpower -- it improves the code, improves your colleagues' skill and team trust, and helps you learn too.

Here are five tips to follow to make the most of the reviews you write.

1.Always remember - it’s a human being on the other end of the review

Code reviews should:

Be kind– even if there’s room for improvement, the message can be delivered with empathy
Be clear– make it easy for the reviewer to understand what you are saying.
To make sure you are communicating correctly, read your code review to yourself out loud and ask yourself, is this something I would want to be said to me? If not, think about changing the tone or content.

2. Give clear suggestions or recommendations

Never tell someone that the code needs to be fixed without giving suggestions or recommendations on what to fix or how to fix it.

3. Always assume good intent.

Code may not be written how you would write it. Let’s say that more clearly: code is rarely written the same way by two different people. After all, code is a craft, not a task on an assembly line.

Tap into a sense of curiosity and appreciation while reviewing – curiosity to understand what the reviewer had in mind and gratitude for what the Coder did or tried to do.

4. Clarify the action and the level of importance.

If you are making an optional suggestion, for example, a β€œnit” that isn't necessary before the code is approved for production, say so clearly.

5. Don't forget that code feedback – and all feedback – includes praise.

It goes without saying that a benefit of doing code reviews is to make the code better and fix issues.

But that's only half of it. On the flip side, code reviews present an excellent opportunity to thank you and appreciate your colleagues' work.

If someone has written particularly elegant or maintainable code or has made a great decision about using a library, let them know!

It's always the right time to share postive, specific feedback.

Top comments (1)

Collapse
 
darronclarison412 profile image
darronclarison412

Great advice on effective code reviews! Recognizing the human aspect in reviews and maintaining kindness while giving clear suggestions is key. Understanding diverse coding styles and assuming good intent fosters a collaborative environment. Clarity on action and appreciating good work through positive feedback completes the feedback loop Here. Thanks for sharing these valuable tips.