DEV Community

Discussion on: Code Review Checklist for Java Beginners

Collapse
 
pedroduarten9 profile image
Pedro Neto

Great article and guidelines.

I just don't agree with number 12 as I believe self-documented code is better code.
I think comments are really useful in very specific cases, where your code can't explain what you want to achieve. About the author and date, the VCS covers that part of the comment.

In number 16 I would just add a default case to every switch case for enums, it is a good practice and helps developers when they add a new value to the enum.

Keep going!

Collapse
 
smartyansh profile image
Anshul Bansal

Thanks @pedroduarten9 for pointing it out. I agree with you on both points.

However, on number 12 it is advised for Java beginners to add comments on class/method which helps in Javadoc, not on the code to explain. As you say - comments are really useful in very specific cases. I'll update the article to mitigate this confusion.

Cheers!