To fail, is to suceed.
From coding horror: The Only Truly Failed Project
Been there. Done that.
I guess my approach is to not even see failures as such. Failure is an opportunity learn a way to not solve a given problem. 10 failures? Nope. It’s learning 10 ways to do something that doesn’t fix your problem.
Software development is a process that requires continual forward movement. I try to learn something new with each and every line of code that I write, even the bad lines and expressions of much larger bad ideas. I don’t WANT to write bad code, but it happens. And sometimes it takes months before I realize the mistake. It’s all a learning process. And when I do “get it right” the first time, I’m unhappy, paranoid, and unsettled. You never want a successful first test, per TDD. The first pass through should result in a failure condition then when you have a successful test you have confidence that the issue has truly been resolved.
What was that cheese-ball line from Galaxy Quest? “Never give up. Never surrender.”

You know, one of these days The Woman is going to start leaving comments on your website, then there will be a whole TWO of us reading it! Ooh lah lah.