(wiki.c2.com) Are Design Patterns Missing Language Features

ROAM_REFS: https://wiki.c2.com/?AreDesignPatternsMissingLanguageFeatures

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.

Local Graph

org-roam f1682ffd-4562-4f76-8bea-dfe7ffd78c39 (www.reddit.com) Design Patterns as m... 09cedc4a-a901-4695-9ca0-5988ef490844 (wiki.c2.com) Are Design Patterns Mis... f1682ffd-4562-4f76-8bea-dfe7ffd78c39->09cedc4a-a901-4695-9ca0-5988ef490844 //wiki.c2.com/?DesignPatterns https://wiki.c2.com/?DesignPatterns 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?DesignPatterns //wiki.c2.com/?VisitorPattern https://wiki.c2.com/?VisitorPattern 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?VisitorPattern //wiki.c2.com/?OnceAndOnlyOnce https://wiki.c2.com/?OnceAndOnlyOnce 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?OnceAndOnlyOnce //wiki.c2.com/?WardsWiki https://wiki.c2.com/?WardsWiki 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?WardsWiki //wiki.c2.com/?PaulGraham https://wiki.c2.com/?PaulGraham 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?PaulGraham //wiki.c2.com/?LanguageSmell https://wiki.c2.com/?LanguageSmell 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?LanguageSmell //www.paulgraham.com/icad.html http://www.paulgraham.com/icad.html 09cedc4a-a901-4695-9ca0-5988ef490844->//www.paulgraham.com/icad.html //wiki.c2.com/?PeterNorvig https://wiki.c2.com/?PeterNorvig 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?PeterNorvig //wiki.c2.com/?DesignPatternsInDynamicProgramming https://wiki.c2.com/?DesignPatternsInDynamicProgramming 09cedc4a-a901-4695-9ca0-5988ef490844->//wiki.c2.com/?DesignPatternsInDynamicProgramming //www.norvig.com/design-patterns/ http://www.norvig.com/design-patterns/ 09cedc4a-a901-4695-9ca0-5988ef490844->//www.norvig.com/design-patterns/