Ahhh-tonomy

No, I'm not kidding. I'm on fire, kids. Just having a good week, cranking out lots of good, working code. I've been kickin' ass and chewin' gum, and I'm almost out of gum. You know how it is: sometimes you're on and sometimes you're not. This week I was on.
Something I'm feeling good about: I have a large degree of autonomy on my latest project. I gathered a pile of requirements and went to town. Just for kicks, I decided to try a development approach I've read about but never got to try in a production environment: refactoring to patterns.

For those of you who are old hands at this, accept my apologies, stop reading this, and go watch Arrested Development instead. The rest of you, if you're still awake, finish reading, then go watch A.D.

The premise is really quite simple, being a marriage of TDD, design patterns, and, crucially, You Ain't Gonna Need It. All you do is start coding to your requirements, doing the simplest thing that will get the job done. When you start seeing patterns, apply them via refactorings. With Eclipse this is so easy it's laughable. The important thing is to resist applying a design pattern until the need for it asserts itself.

"You dork," you may be saying. "So, if I'm building a web app in Struts, I should eschew MVC until I can prove I need it?" Naw. MVC is like a meta-pattern anyway. But even trying to resist prematurely applying patterns can lead to some enlightening moments. The code I've written this week is the lightest, most elegant, well-structured code I've ever coughed up. So I'm floating on a pink cloud, and eventually the honeymoon will end. But right now I'm stoked on this refactor-to-patterns approach. Give it a try if you get a chance.