Friday, 30 September 2022

Java : How to do Code Review?

I will be adding examples of PR comments that are helpful and would be classified as value-adding comments.

Note: Pull the code in your local and go through your IDE and PR changeset side by side. Having it open in IDE helps in finding Definitions and usages.



1. This is a good comment because in-depth it asks the coder to move their code somewhere else with reasons behind it than just saying good design pattern. Why is that pattern good? Useful if you comment for others.



This should majorly have resulted in compliance with your requested changeset: however, there are a few things for which you might get rejected, prompting further discussion. 
  • code is specifically handling a particular scenario that does not warrant being moved to a generic class or being used by others. 
  • you do not want it to be used by others.
  • code is a simplistic approach and would require more generic and complex changeset to be implemented in the common interface for a small use case which might make it out of scope.

2. Another review comment I think was done well because it targets a code pattern related to an abstract class. 





Couple of links :