How to Code Review

Edu Depetris

- Sep 20, 2024
  • Playbook
  • Team Collaboration
  • Code Review
I’ve been sharing this over many years, and it is now part of our playbook.

The workflow

At plum this is how we learn and how we teach. It’s part of our educational process and we encourage an environment where feedback is given in a positive, respectful manner, focusing on code improvement, knowledge sharing, and maintaining high standards. Kaizen — our culture of continue learning is being manifested here.

Everyone is responsible for reviewing others changes.

Strategies

  • It can be helpful to set aside a specific time in your day to code review others PR’s. For example: first thing in the morning. “eat PRs for breakfast”.
  • Make use of the GitHub Slack application, which can remind you to leave reviews.
  • If you are in the middle of a focused task, such as writing code, don’t interrupt yourself to do a code review

Performing

  • Follow Correct, Secure, Readable, Elegant, Altruist? https://www.dein.fr/2015-02-18-maslows-pyramid-of-code-review.html
  • Make two passes over the PR if it's substantial. 
    • On the first pass, come to an understanding of the code change at a high level.
    • On the second pass, pay more attention to semantic details.
  • Optimize the Process with LGTM with Comments: In situations where the changes are minor or the reviewer trusts the developer to handle remaining issues, it's effective to give an LGTM while leaving comments. This approach helps in speeding up the process, especially across different time zones, allowing for continuous progress without significant delays. Specifying the intent of unresolved comments can help in this streamlined approach

Requesting a change

  • Be as clear as possible in your comments. Use a professional language.

Approving

  • Let the developer know with LGTM/👍 [or other synonymous emoji, such as 🚢 ,🚀 or :shipit:]

Relevant links


Happy Coding!