Gang of Four (GoF)
Kent Beck
Ward Cunningham
To some they are the Pied Pipers of the design movement in software architecture and development. They are legend. They are the pinnacle of professional achievement.
The GoF defined 23 design patterns that are near gospel, if not alpha and omega of the design encyclopedia. It is fundamental to learn most, if not all, of the design patterns. One might even use all of them some day in professional work.
Kent Beck and Ward Cunningham extended these patterns and even described patterns of production that go beyond coding structures. These men and their ideas are viewed, mostly, as heroes of the industry.
The Cargo Cult
But I see a dark and terrifying threat by the sacrament of patterns: Cargo Cult Programming.
What do you get with an art class and fifty pounds of clay? Fifty pounds of ashtrays.
Programming by example, as we all know, produces uninformed, poorly designed (none, really), poorly structured solutions.
What do you get with a programming class and fifty pounds of tutorials? Fifty pounds of “Hello, World.”
After witnessing these amazing categorizations of design patterns, the acolyte begs nothing more than a chance to use them; to be like his or her heroes. “Using these patterns,” s/he presumes, “will make me just like them.”
These become the Crusaders – the protectors of the righteous patterns. These programmers, armed with an immensely inflated power of the reference, threaten the quality and content of the application solution by insisting – for no other reason except they are the experts in them – on using as many patterns as they can conflate into the pitiable team.
Set patterns, incapable of adaptability, of pliability, only offer a better cage. Truth is outside of all patterns.
::Bruce Lee, Tao of Jeet Kune Do
The Tutorial
A similar result derives from a wholly different genesis: the tutorial.
Microsoft, bless their pea-pickin’ hearts, are the kings of he tutorial. Their tutorials, I claim, are the only reason they include built-in tools and components in their Visual Studio deliverable. (This is because the quality and capabilities of these components are so minimal and lacking, the only serve to provide the tutorial writer and the poor schmuck who actually believes that s/he will learn programming by following such tripe.) But the tutorial programmer is a bane to the project, as they never show the least awareness of any further complexity in a project.
The problem with this currency is that is the value of the store. Whether it is the crusty penny of the tutorial or the shiny silver dollar of the pattern, It doesn’t measure quality nor even the accuracy of the solution, It measures how well the coder followed the rules. By any measure, that’s a bad coin no matter which side you call.
Don’t get me wrong. Every cadet in West Point studies the history of war. But at the same time we learn after we’re done and we study the next war, we started fighting the next war like we fought the last one.
You fight like you train.
::U.S. Navy Fighter Weapons School, TOPGUN
Or the way you studied hardest.
We must all study the pattern. We must all understand the tutorial at first. But that’s where the lesson starts, not where it stops. Unfortunately, the end is the means.
Which brings about the one pattern that nobody likes to see and about which no one should brag: building software like the tutorial or putting in a pattern because you saw it done in a book. And you liked the book. And you think patterns make you cool.
Solving Problems Through Code
Software programming is not about patterns. I don’t care what people say. Software programming is not about using the code you learned from the tutorial.
Software programming is about solving the problem in the best way possible, using the fewest resources, building the best possible platform from which modifications, extensions, expansions, and promotions can be made.
There is a land where tutorials and software design patterns are learned intensely and applied irrationally. Etched in constants above the gate to this land is a warning sign:
Inspiration Will Be Shot On Sight