Patterns Vs. XP

There's an article on O'Reilly right now called Patterns, Hype and Snobbery which responds to a JDJ article about programmers who use patterns as some sort of whip against less experienced - or more likely less indoctrinated - programmers. I can see this happening already in the working world here. Those who subscribe to the J2EE madness also have swallowed whole the idea that Patterns are holy scripture.

The article is good becuase it tries to restate what the original intentions of Patterns were - encapsulating hard-earned experience into a format that can be learned and used by less experienced programmers. This is good. The problem is that people who subscribe to this way of thinking, forget the lessions learned in the Extreme Programming (XP) model of development which says (in part) Never Add Functionality Early.

Pattern snobs want to throw in patterns where ever and when ever they can, regardless of their utility in that moment, preparing for reuse or expansion that might never come. Don't get me wrong, many patterns are so simple that you might as well use them while you're there. But other patterns need a lot of pipe-laying that many times is over kill for the situation. You end up having code separated into a million pieces, interfaces or abstract classes that are used by only one subclass, and a bunch of effort made doing development that isn't needed.

The J2EE guys have latched on to Patterns (and it's evil sibling UML) as some sort of salvation from the obscene complexity of the spec in general, and I can tell you right now that it's not doing anything but driving MORE people to the MS camp desperate to get away from the bajillions of lines of code they have to wade through every day in order to do the simplest thing. At the base of EVERY business application on the planet is a simple action: reading from and writing to a database. Every layer you put between your user and the db is one more useless abstraction. Each additional layer you need in your application doubles the complexity of the whole. Web to Servlet to Session to DAO to Object Mapping to DB is RIDICULOUS. Almost every pattern involves making more and more layers in your code, and every one makes my skin crawl.

But I digress.

Patterns are all well and good, but I think the developers should learn how to do XP development first, and add pattern knowledge on top of it. Not that I'm an expert in either, I'm just gettting tired of over-development. Wading through 20 classes and 14,000 lines of code to display a "select first_name, last_name from client where id=10" is just too much...


< Previous         Next >