4 ms·
These are all great points in favour of TDD. They're a ratchet on your code that lets you crank it out in small increments without losing much progress. I feel
by taneq 7y ago
These are all great points in favour of TDD. They're a ratchet on your code that lets you crank it out in small increments without losing much progress.
I feel like this only helps with distractions and interruptions, though, if you're doing routine work that you already fully understand and can code 'off the top of your head'. Admittedly this is the entirety of many software jobs and the bulk of even the most challenging, but there's still sometimes a need for time to think unimpeded.
- RangerScience 7y agoMore or less the case here; wrote this project, now refactoring and adding tests. Not every part of it could be done while 'distracted'. Good testing still helps with distractions because good testing enforces a code style that's very bite-sized; so if your 'tasks' are 20-40m, you can fit a lot of distractions. Also, each task (generally) by virtue of being so small takes up less mental RAM, so you don't have to page out as much when a distraction happens. Also makes it easy to work "around" the hard part, and come back to it when you know you'll have that uninterrupted time. Or late that night when inspiration strikes and now it's easy :)
- thesz 7y agoI wonder, what kind of problem domain would allow such small and local programming?
- RangerScience 7y agoChat bot. brian.bot The hard / complex part is (first) parsing parts of a Slack conversation to the do the AI part, and (second) the Slack interactive messages, which get weird when you try to use them as a form. a lot of just "if these messages happen in this order, this correct thing still happens", where the difference between different message types is, well, not minimal, but simple and straightforward. This has definitely led to waaay to much copy pasta, but it's well encapsulated within the test fixtures.