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

Tests are a technique to manage programmer anxiety about code. When I feel anxious about some aspect of my code I write a test case.

Does programming language affect level of anxiety? Definitely. Does programmer skill affect level of anxiety? Absolutely.

Writing tests becomes more important when you're part of a team. Your choices affect not just your anxiety but that of your teammates. That's why it's reasonable to be more dogmatic about TDD in a team.

A lot of 'getting better at TDD' is just getting better at listening to yourself. When I started programming the little anxieties would pile up until I'd painted myself into a corner. With experience I pay more attention to the little anxieties.

After some time doing TDD I feel less anxious just knowing that I can write a test if I want. The benefit of the tests as an artifact is secondary to me; what they primarily do is keep me from getting stressed and giving up to go play poker.

Tests are a technique to manage programmer anxiety about code.

Sorry, but I think this is bullshit. If it were true, you could replace unit testing by medication.

Hey, I'm telling you what works for me.

And I don't have to worry about side effects from writing tests.

You're taking me too literally when I say I want to manage anxiety. If medication is a solution, so is not hacking at all, or just remaining inexperienced and non-introspective about my coding. Anxiety usually has good reason, and it requires improving the _codebase_. But my metric for how the codebase is doing is my own perception as I live and breathe it.

I have a love-hate relationship with anxiety. I need to listen to my perceptions, because that's key to where the code comes from. But those perceptions also have the ability to demotivate me away from the code. It seems like an obvious connection to me ever since my experience with burnout. Learning about the non-linearities in my motivational structure makes me a better programmer.

Has Kent Beck influenced me? Definitely. Listening to myself works for me. I don't see how thinking more about how I operate and how I learn my skills can do more harm than good. Paraphrasing Sun Tzu, "Know yourself". http://en.wikiquote.org/wiki/Sun_Tzu

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