227 words, 2 min read

Some very good code review advise from The System Design Newsletter:

Both the author and the reviewer should respect each other’s time and efforts.

Here are some guidelines for the code author:

  • Follow the project's style guide2.
  • Keep the changes small to make the reviews easy.
  • Review the code yourself before asking others to save time.
  • Use existing code patterns, and not personal preferences, if a style is unspecified.
  • Tag only the fewest number of reviewers to save everyone’s time.
  • Write a clear message about the changes for the reviewer to understand easily.
  • Use facts and data to resolve design debates, rather than opinions.

Code reviews are each software engineer's responsibility.

Here are some guidelines for the reviewer:

  • Respond to a review request within 24 hours.
  • Reserve at least one calendar slot each day for code reviews.
  • Keep the reviews polite and constructive; don’t criticize the author.
  • Document common review points and use a review checklist for consistent reviews.
  • Discuss the issue directly with the author when there’s a disagreement. Then document the solution for future reference.
  • Share the documentation in review comments if necessary to encourage knowledge sharing.
  • Approve the pull request when it’s good enough and allow minor issues to be fixed later.

Remember, code reviews are about making progress and not perfection. So just make sure each change maintains or improves the codebase's health.