Code review best practices

Code reviews are one of the most important aspects of today’s software development workflow. With that in mind, I want to share some code review best practices with you. It is not an exhaustive list, but it can be a good starting point for you and your team.

For code author

  • Aim for small changes
  • Group code changes that are related
  • Read through your code carefully
  • before submitting it for review
  • Run tests before submitting the code for review
  • Use commit templates
  • Describe the purpose of the code change
  • Add junior developers to the review to let them learn
  • Add experienced developers if you need them
  • Do not add too many reviewers
  • Be open to comments and suggestions
  • Show respect to the reviewers
  • Thank the reviewer for their comments and suggestions

For code reviewer

  • Give respectful and constructive feedback
  • Give clear and actionable suggestions or recommendations
  • Specify the changes that the author needs to make and their level of importance
  • Ensure traceability for decisions
  • Give feedback on time
  • Focus mainly on core issues
  • Talk directly with the author, if necessary
  • Reduce multitasking and task switching as it reduces productivity
  • Don’t forget that great feedback include praise
  • Use a code review checklist

:bulb:If you want to dive deeper into code reviews, we created a guide that explains in detail what code reviews are and how to optimize them. We even give you checklists to help you become the best code reviewer you can be. Check it out!