4 ms·
What the code does is not always obvious without quite detailed analysis. In those cases a comment does help. In general, if I have to put some effort into a p
by mytailorisrich 7y ago
What the code does is not always obvious without quite detailed analysis. In those cases a comment does help.
In general, if I have to put some effort into a piece of code and I understand now only because I put that effort in then my future self won't immediately understand it in 6 months time (and right now I'm the only person to understand it immediately). In these cases, 'how' comments help.
Commenting is mostly common sense, imho.