2 ms·
> The thing is that most of the conditionals were never hit under ideal conditions (like passing all args etc.). Your debugging work in this case might have al
by pmarreck 10y ago
> The thing is that most of the conditionals were never hit under ideal conditions (like passing all args etc.).
Your debugging work in this case might have also been alleviated by a good unit test covering this functionality.
- hashhar 10y agoIt would have been. But it wasn't my code, I was merely using it. I think better structuring would have helped the code much more than unit tests. Unit tests are good to ensure you don't break things. But spaghetti code that passes tests is still considered broken by my standards.
- pmarreck 10y ago> I think better structuring would have helped the code much more than unit tests. This is why you TDD. Your code will automatically become more modular/structured by the very nature of having to unit-test it "right then and there" instead of hours later when you finished the component without any tests and decide to bang out a few basic integration tests and then head to happy hour and call it a day. > Unit tests are good to ensure you don't break things. But spaghetti code that passes tests is still considered broken by my standards. I agree, that's still technical debt. You literally cannot write spaghetti code if you TDD, though. You would feel a massive friction.