Ah TDD, I love you. Let me count the ways... (a thread)
When I pause working on a code base, if I leave a failing test on my local machine it reminds me where I left off, lowering the friction to getting started again.
In learning a language I can make small guesses that are easy to correct from if wrong.
By working in tiny steps, mistakes are super easy and quick to recover from. And the tests force me to work in small steps, and not get ahead of myself.
By forcing myself to see a test fail before making it pass, I don't fool myself into thinking I've actually written the code I intended to write, when all I've actually done is write code that doesn't error out.
When I discover that despite having TDD'd a thing, I had a hole in my logic, it is incredibly easy to fill in the missing tests and see what was broken.
It creates a safety net that protects the code from unintended consequences. That is: when I introduce a change that does what I intended, but that breaks logic that worked before -- even if it only breaks it in subtle ways -- it is immediately apparent.
But perhaps best of all, by TDDing, I protect myself from the crashing disillusionment of thinking I'm moving fast when I'm actually just creating a tangled mess that will take hours to sort out, or need to be thrown away.
You can follow @testobsessed.
Tip: mention @threader_app on a Twitter thread with the keyword “compile” to get a link to it.
Enjoy Threader? Sign up.
Since you’re here...
... we’re asking visitors like you to make a contribution to support this independent project. In these uncertain times, access to information is vital. Threader gets 1,000,000+ visits a month and our iOS Twitter client was featured as an App of the Day by Apple. Your financial support will help two developers to keep working on this app. Everyone’s contribution, big or small, is so valuable. Support Threader by becoming premium or by donating on PayPal. Thank you.