3 ms·
> You literally cannot add too many comments to test code In my opinion, almost every developer I've worked with who advocated for generous amounts of comments
by asalahli 2y ago
> You literally cannot add too many comments to test code
In my opinion, almost every developer I've worked with who advocated for generous amounts of comments has overestimated their (and or others') ability to write good quality comments.
Obvious ones like `a = b; // set a to b` while useless are also mostly harmless, but I've been lead astray by outright factually wrong comments, many more times than I can count. I certainly don't feel confident in my own ability to not write factually incorrect comments. So yeah, I'd rather the code do the talking.
- adamtaylor_13 2y agoThat’s why your comments should be on things you know to be factual like WHY you made a certain decision. Things like that cannot always be communicated by good variables and functions.
- Izkata 2y agoI suspect they mean in tests, not in general code as hints about testing. A comment block that explains a bit why that test is doing what it's doing can be amazing.