Jim Weirich is here at the Rails Edge talking about design patterns. As he and many other people have pointed out, design patterns are language specific. In sufficiently expressive languages, many design patterns become library calls or disappear entirely. For example, does
Iterator deserve to be a design pattern in Java? There's an interface for it, after all. Many design patterns have direct library representations in Ruby:
Quite a while back, Peter Norvig proposed some terminology to deal with the gradual disappearance of certain patterns:
- An invisible pattern is so much part of your language that you do not perceive it as a pattern. For example, "Encapsulation" is not a pattern in Java.
- A formal pattern has an explicit library or macro realization, e.g. Ruby's
- An informal pattern is not captured by the language.
Far too many pattern enthusiasts relish informal patterns, when we should be trying to convert them to formal or invisible ones.