“Programming patterns” sounds unsexy and boring, something from the depths of BigCorp programming practices written entirely in legacy Java. But you’d be wrong. Programming patterns are the beautiful philosophies of programming, masked in the beige veil of giant enterprise solutions past.
Patterns are only ideas. While many force substance to them, in reality they are flexible and blurry, shifting as they’re scrutinized. This revelation came as I was studying the MVVM pattern for building apps using XAML. I was reading this excellent Codeproject article by Jeremy Likness and I got to one of the final paragraphs, titled “What MVVM Isn’t”; I’ve quoted the relevant section below (emphasis mine):
MVVM isn’t a complete framework. It’s a pattern, and might be part of a framework, but it’s only a piece of the overall solution for your application architecture. It doesn’t address, and doesn’t really care, about what happens on your server or how your services are put together. It does stress separation of concerns, which is nice.
In reading this, I was reminded very much of a section from the Unix Koans, specifically “Master Foo Discourses on the Unix-Nature”. Here’s the exact quote I have in mind:
“What, then, is the Unix-nature?” asked the student.
Master Foo replied:
“Not code. Not name. Not mind. Not things. Always changing, yet never changing.”
“The Unix-nature is simple and empty. Because it is simple and empty, it is more powerful than a typhoon.“
“Moving in accordance with the law of nature, it unfolds inexorably in the minds of programmers, assimilating designs to its own nature. All software that would compete with it must become like to it; empty, empty, profoundly empty, perfectly void, hail!”
Upon hearing this, the student was enlightened.
Though rather heavy on the style, the basic idea is there: the Unix Nature is an idea, an approach, a philosophy. In a similar, but smaller way design patterns are the same. They are a pattern, an idea, an approach (though maybe not quite a philosophy).
I guess in the end, I hope this changes some people’s perspective about what design patterns are, so they don’t feel how I used to feel.