2 ms·
In my experience the worst code that I have seen was the one with the most comments. If your code is self-explaining, if you have a full test coverage that docu
by tigershark 10y ago
In my experience the worst code that I have seen was the one with the most comments.
If your code is self-explaining, if you have a full test coverage that documents what the code does and how it should be used then the comments are completely useless unless you are publishing a library or an external API.
In my current job I am required to add this completely useless Java Doc / xml doc comments for an application on which only I am working on, that is far more clear than the rest of the codebase, with extensive test coverage and currently I have the same amount of LOC and comments.
It's a total and utter waste of my time and it decreases the productivity so much trying to read the code in the middle of the comments that I had to find a visual studio and Idea extension to hide the comments to avoid getting distracted by all that awful noise.
Needless to say that I completely disagree with the author of the article and I hope that people sooner rather than later will understand that the living documentation of the code is in the code itself and in the tests that, by definition, can't ever be out of sync like the comments.