|
|
|
|
|
by _ea1k
5225 days ago
|
|
The TDD issue is really the biggest for me. I've run into many developers over the years who shout how much more efficiently things would be built if we all just did that. Surprisingly few do it themselves, though, due to a "lack of time". The contradiction in that never quite hits them for some reason. TDD has it's place, but taking it as an incontrovertible dogma is not useful. |
|
> I never spoke out 'against' TDD. What I have said is, life is short and there are only a finite number of hours in a day. So, we have to make choices about how we spend our time. If we spend it writing tests, that is time we are not spending doing something else. Each of us needs to assess how best to spend our time in order to maximize our results, both in quantity and quality. If people think that spending fifty percent of their time writing tests maximizes their results—okay for them. I’m sure that’s not true for me—I’d rather spend that time thinking about my problem. I’m certain that, for me, this produces better solutions, with fewer defects, than any other use of my time. A bad design with a complete test suite is still a bad design. (http://www.codequarterly.com/2011/rich-hickey/)
Another question to ask is does this help others understand the problem? You often don't write tests for yourself, but for other people, including the later you that has popped the problem off the mental stack long ago. Writing tests might lose you time right now, but the net gain of time saved by others may make up for it. Let me emphasize the word "may", because you might make the problem clearer by writing documentation in English rather than code. So the only conclusion is that it depends, it depends...