(wiki.c2.com) Are Design Patterns Missing Language Features
ROAM_REFS: https://wiki.c2.com/?AreDesignPatternsMissingLanguageFeatures
- Are Design Patterns Missing Language Features
On various places, it has been claimed that use of DesignPatterns, especially complex ones like VisitorPattern, are actually indicators that the language being used isn't powerful enough. Many DesignPatterns are by convention rather than encapsulable in a library or component, and as such contain repetition and thus violate OnceAndOnlyOnce. If it didn't contain at least some repetition, or something that could be Refactored out, then it wouldn't be a pattern.
Discussion on this topic culled from elsewhere on WardsWiki:
Here is an interesting quote from PaulGraham, which leads to the question "Are Patterns a LanguageSmell?"
This practice is not only common, but institutionalized. For example, in the OO world you hear a good deal about "patterns". I wonder if these patterns are not sometimes evidence of case (c), the human compiler, at work. When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I'm using abstractions that aren't powerful enough - often that I'm generating by hand the expansions of some macro that I need to write.
from http://www.paulgraham.com/icad.html
PeterNorvig argues in the same vein in "DesignPatternsInDynamicProgramming".
PaulGraham said "Peter Norvig found that 16 of the 23 patterns in Design Patterns were 'invisible or simpler' in Lisp." http://www.norvig.com/design-patterns/
"Pattern" generally implies there is some kind of duplication. Duplication should ideally be factored out (OnceAndOnlyOnce) so that only the differences remain. It appears to me that stronger languages can more easily remove such duplication because sometimes one has to make a kind of sub-language to do it.