6 ms·
> Comments - like documentation - are a liability. Tests, too. But you wouldn't advocate not having tests, right?
by wulczer 14y ago
> Comments - like documentation - are a liability.
Tests, too. But you wouldn't advocate not having tests, right?
- seanmcdirmid 14y agoTests that are executed automatically as regression are fine. There is now way to regress with comments. Tl;dr not equivalent.
- plorkyeran 14y agoThis is one of the reasons why I'm a fan of doctests in python. Generally if the tests start to fail the documentation surrounding it needs to be updated as well, which makes it a bit easier to actually keep the documentation up to date.
- swanson 14y agoIt all comes down to: does the benefit out way the costs? A well-maintained suite of automated tests provide an enormous benefit. A brittle set of Selenium scripts costs a project more than paying a Tester to manually run scenarios.
- wulczer 14y agoYeah, I agree, it's a question of cost vs benefit. A bunch of tests that check trivial cases is not helpful at all, a well-maintained suite of tests is very useful. What I mean is that a bunch of documentation that only states the obvious is not helpful at all. A set of well-maintained (!) code comments can make navigating unfamiliar code much, much easier.
- enjo 14y agoI can prove that tests don't function. They are exactly the opposite of comments in that way. Change the functionality? Tests fail. I know they fail. I fix them. Yet comments can (and do) go way out of date.