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

I couldn't agree more. I work in robotics, and all of the software folk at our lab try to adhere to a very TDD/BDD based workflow; working here is the first time I've been exposed to it, and it's changed the way that I code not so much by altering the quality (though this has probably improved as a side-effect), but by making me more "productive" in the short term.

I'm a serial procrastinator; not in the cutesy demotivational poster way, but in a way that is legitimately harmful to my productivity and success if I don't find a way to reign it in. It was a big problem years ago. I failed classes in school, missed deadlines at old jobs and internships. I've become a lot better at being responsible, but every now and again I feel the same old apathy set in, and I can go a day or two at around 50% of my normal output. I find that when I need to start writing a new Class or do anything that might be front-loaded in the cognitive effort department, or just suffering from a block in general, it helps to just start writing code, no matter what it is. The process of hitting keys acts a great sort of ignition and warm-up for the diesel engine that is my brain. If I'm going to mindlessly hammer out code, it would help if it's useful. And a well-formed unit test, by its very nature, should be small, simple, and informative of the behavior of the code that it tests but shouldn't actually be all that cognitively taxing to write if you understand the nature of the problem but haven't landed on an implementation. Brain-dumping a behavioral outline that happens to be useful and in code form is much more useful than trying to hack on the problem I'm actually trying to solve and having to go back later and engage in a refactoring marathon.

In this way, practicing TDD has helped me lay out a system to kick-start myself when I start to slump. I realize that this is just one of many possible means to an end, but it's the one that works for me.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: