First of all, I think code reviews are a must for every team that wants to have a consistent codebase and good code quality. ⭐
Code review should be a really focused task, and I think those are the top things that need to be watched:
Code structure & common patterns used
Is the code structured correctly and following the same trends and patterns as the rest of the application? If it breaks from those patterns is it a good reason to do so?
Does it follow good namig conventions? Are FP principles used? Are unit or integration tests present? If existing code is modified and it had automated tests to cover it, have the tests been updated to also check the new logic?
If certain parts are badly written, too complex or unreadable, then suggest alternatives.
Write good comments
This is something on you, the reviewer:
- Be empathetic and kind when leaving comments
- Even for horrible mistakes, try to point them out in a nice way
Use automation 🚀
Can you automate more to make some general mistakes occur less often?
- avoid formatting comments by using a code formatter
- avoid some code quality comments by using linters
- use static type checking to avoid pointing out mistyping comments
Most important ❗ discuss more upfront when a teammate has a challenging task so the outcome is more predictable (have a huddle task for complex work).
If you like this article, chances are you will also enjoy what I post on Twitter. 🔥