Thursday, May 1, 2008

Taking the GoF to the Woodshed

In this rant (discovered via reddit), Christer Ericson takes the "Gang of Four", otherwise known as the authors of "Design Patterns," to task. My standard line regarding Design Patterns is that it's the worst travesty ever visited on the software engineering profession.

Yes, yes, a couple of the construction patterns are truly useful, but by and large, otherwise smart engineers that have been badly infected with the design patterns meme are worse than useless, they are actively harmful: they end up writing a thousand lines of code to accomplish what could have been done in fifty, nothing can be accomplished in their behemoth frameworks with fewer than five virtual function calls, and they're shocked to discover that the cost of those calls really adds up when they're made smack in the middle of the hottest loop of the application.

My feeling is that the pendulum reached its extreme on this issue a few years ago, but I'm always pleased to see another partisan on my side of the fight.

1 comment:

DF said...

Opening a patterns book and trying to use the patterns has often turned into a huge mish-mash of junk.

However, whoever said you had to do that? Their book was preached as gospel, and religion often goes awry.

I think it was useful to write such a book simply to encourage thoughts about patterns that occur at a larger-than-a-single-language level. At least Singleton, Factory, and Flyweight have influenced my thinking, although rarely my coding directly.