/force-code-review-checklists

These are the checklists I use for code reviews on Force.com projects.

MIT LicenseMIT

Force.com Code Review Checklists

I am a big advocate of code reviews. I strongly encourage every team to adopt code reviews before merging each one's contribution into the codebase. Code reviews don't take long and have many benefits:

  • they make developers learn from each other
  • they encourage people to write better code
  • they help disseminating best practices
  • they help keeping the code internally consistent and easier to maintain
  • they reduce costs due to later reworks

These are the checklists I use for code reviews when working on Force.com projects. Enjoy!

Tips for developers

  • Keep your code simple. Do not overcomplicate problems.
  • Keep your code easy to read for humans.
  • Avoid everything that is not necessary: every line of code that is not needed is a potential bug.
  • Remember that the point of reviews is to spot problems. Don't take things personally.
  • Accept you will make mistakes.

Tips for reviewers

  • Code reviews should last no more than 15 minutes.
  • Try to review no more than 400 lines of code at a time.
  • Ask questions rather than making statements.
  • Avoid asking "Why did you do X?". Ask instead "Have you considered Y?"
  • Treat people who know less than you with respect and patience.
  • Remember to praise.
  • Remember that there is often more than one way to approach a solution.