3 ms·
There are 4 main types of comments I use: - javadocs: at the top of the function. Explains what you need to expect from it, very useful when autocompleting (ye
by TrianguloY 5y ago
There are 4 main types of comments I use:
- javadocs: at the top of the function. Explains what you need to expect from it, very useful when autocompleting (yes, you can go read the code...but that's slow)
- block description: before a bunch of lines. Explains what they do without need to read and understand them all, so you can read them faster.
- line description: at the right of a line of code. Explains the use of a specific variable, the reason you used a function call, etc.
- flow descriptor: the line after an if, an else and other path divisions like while or for. Explains why the code took that path. Useful when you need to understand the context of a specific line.