Hacker News new | past | comments | ask | show | jobs | submit login

I think the thing is, you can absolutely write the code and then write the tests afterwards, but you might end up with something that is hard to test (which is probably an indication your code is not properly modularized).

You should take that as a sign you need to rewrite the code you’ve just written, but a lot of people don’t want to trash all (or part of) their hard work and instead bend the tests so that they deal with the code.

You now have bad code, and you have bad/fragile tests.

I think TDD (when enforced) is mostly meant to prevent people from falling for that.




I think people with enough experience in software development know quite well if the code they are currently writing is going to be testable or not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: