0
Are documentation comments really necessary to remember
4 Answers
+ 9
Comments are there to help you (or anyone else) to understand the code better. Depends on who you work for, there may be different standards on how comments are supposed to be written.
+ 6
Daniel Silva If you think you can comprehend your code without comments, it is fine to omit them.
However, we have to consider those who are not programming-savvy. Our comments should also make it easier for beginners to understand what we are doing.
+ 2
Comments are there to describe the intent of the code (ie, what it is for), not paraphrasing how it is done in code( clean code is self explanatory).
If you write comment, best is to write it in a standard so that tools can extract them for documentation.
example, ., javadoc is used for the documentation of java libraries.
+ 1
is a good practice when you have a long code but if your code is clean, you use indentation and your variables have are good identified, you can forget it if you want, although i do not recommend it at all