3 ms·
Bad comments are like bad tests, they're bad. Good comments, like good tests, are a boon for complex software.
by wulczer 14y ago
Bad comments are like bad tests, they're bad. Good comments, like good tests, are a boon for complex software.
- seanmcdirmid 14y agoA test will at least fail when wrong, a bad comment will just be confusing.
- garethadams 14y agoA 'bad test' isn't one that is failing, it's one that doesn't test anything useful, or worse tests something useful but incorrectly
- wulczer 14y agoYes, thank you, sorry for too big of a mental shortcut. By bad tests I mean trivial tests (much like trivial comments that just state the obvious), or ones that work on an assumption that need not be generally true and thus changes of the code that are correct from a logic standpoint might still make them fail.
- seanmcdirmid 14y agoThen such bad tests don't mislead, they are just a waste of energy and provide no assurance. At least if the test fails and the code is good, you will know to fix the test. Nothing like that with comments written in human natural language.