News for hackers. Stuff that matters.
Re:Ask HN: Do you write tests before the implementation? by lowercased on Friday November 15, 2019 @07:42AM (#21544319)
> Just keeping in mind that you have to write a test for your code, changes how you write it.

Which is often enough to ensure the code is testable.

Generally, I'll write some tests sort of alongside, or soon after (like, a couple hours or a day) to not lose the initial thought process. Going back to code days/weeks later and trying to 'test' it when it wasn't conceived of as testable is tough.

There are no comments on this comment yet.