3 ms·
Swings and roundabouts: what you lose on writing tests you gain on not bothering to implement things you don't need. If the test passes, you stop. Without the
by regularfry 5y ago
Swings and roundabouts: what you lose on writing tests you gain on not bothering to implement things you don't need. If the test passes, you stop.
Without the tests to guide you it's very easy to waste time over-engineering, even if what you're building is well-structured.
- brabel 5y agoI often write code without implementing anything, just the "surface API". That's when I find whether things will work or not. Tests are a hindrance to that. Once I figure out the design, then I will test all that I think is important. > what you lose on writing tests you gain on not bothering to implement things you don't need. I am not sure where to start... I've written so much code, applications, libraries, algorithms... and I am pretty sure the opposite of what you say is true: with TDD, I would've spent hours trying to get something working that later I would find, by exploration, that I didn't need at all.
- regularfry 5y ago> I often write code without implementing anything, just the "surface API". That's when I find whether things will work or not. There's an entire school of TDD which works this way. That's not incompatible at all. > with TDD, I would've spent hours trying to get something working that later I would find, by exploration, that I didn't need at all. If you're writing tests for something you don't need, the problem isn't with TDD as I understand it.