For the last couple of days I've been trying to resolve a bug in an application I'm writing for a client. As I was testing and re-writing the component a first time, a thought jumped into my head, "I' shouldn't be doing it this way. It feels wrong".

A second re-write later to the component backed by tests and my conclusions were correct, I was doing it wrong. It's hard to explain if you're not a developer, so I won't go into the details, but it boils down to best practices. I initially implemented this component one way when I should have implemented it another way. It's taken me a bit longer to get there, but get there I did.

Should I be hard on myself at the fact that I didn't think of this initially? I don't think so. It's easy to be pointed in the right direction when you're part of a team with a shared pool of knowledge. When you're working on your own, you can't be always switched on to the best practices for everything that you do. Practice it enough though and it will stick eventually.