3 ms·
That's an edgy thing to post, tbh, in terms of how HN readers will take this. I think there are 2 arguments for TDD: 1. For at least some bits of your code, y
by maest 4y ago
That's an edgy thing to post, tbh, in terms of how HN readers will take this.
I think there are 2 arguments for TDD:
1. For at least some bits of your code, you would benefit from having tests. Writing tests after the fact is a pain, so might as well start with them.
2. Even for highly skilled programmers who enjoy thinking about their code deeply as they write it, there is still a class of difficult algorithms where they would benefit by writing the tests first. I'm thinking about stuff like tricky graph algorithms or scientific computations etc.
That being said, I generally have found TDD to be too onerous - except for maybe 1% of the time when I do find the extra safety brought by the tests to be useful.