2 ms·
Pardon the virulence, but this is idiotic advice. Or at the very least, an idiotic generalization. Sure, comments that tell what a single line of code do are n
by norswap 13y ago
Pardon the virulence, but this is idiotic advice. Or at the very least, an idiotic generalization.
Sure, comments that tell what a single line of code do are not very useful. They are verbose.
But you definetely should comment on your architecture. What is the role of this class? How does it interact with other classes? Paint me a small picture that helps me quickly grok your software.
Functions/methods also, should be commented: are there inputs that are invalid? Should a particular relation between the inputs be respected? To understand a piece of code, I do not want to read every other piece of code it calls into. A few English sentences are definitely much help. If you use an IDE and a statically typed language, you can even display that by hovering over the function name.
Developers don't need this kind of encouragement. I have never been bothered by excess comments when reading code (at worst a few inaccuracies have crept in), but I almost always wish for more comments and documentation in general.