I know, let’s build a Facade using a Strategy that takes a Command to build its Memento and we can modify it using a Builder! Oh, and I think it should be a Singleton.
– famous last words, number 629 in a series
A few weeks ago, a colleague mentioned in passing that he had spoken with a more junior developer who was attempting to bridge the gap between procedural and object oriented programming starting with Design Patterns. Talk about shifting paradigms without a clutch!
According to the Dreyfus model of skill acquisition, experts come to rely on intuition and experience whereas novices depend on explicit instructions and detailed rules. Yet many a sage ur-guru has suggested the path to object oriented enlightenment crosses through the valley of the Gang of Four. I call this the expert’s folly.
Design Patterns are descriptive, not prescriptive. While the wizards may describe their caching policy as a “Decorated Proxy” using a convenient shared vocabulary, novices barking their shins in the dark create Singletons and States without any regard for data encapsulation, domain modularity, or coherent behaviour. It’s the Golden rule turned lead. Experts feed advice they would like when following the Platinum Rule would yield smoother sailing.
It is often said that those who can, do; those who cannot, teach. But that glorifies the wrong side of the scale. It’s easy to perform based on your intuition, but very difficult to teach based on your understanding. I think this ancient aphorism needs an update:
Those who cannot teach, merely do.