Talk:Software design pattern/Archive 3

From Wikipedia, the free encyclopedia

Archive 1Archive 2Archive 3Archive 4Archive 5

An anon removed the cricicism section iwith the comment

(Moved valid information out of a criticisms section into the rest of the article. In the process, removed information that was the result of the writer's personal ignorance.)

Criticism section

The remove material is

should any of this be restored?--Salix (talk): 08:09, 4 November 2010 (UTC)

I'd say, go ahead and re-include this section. Perhaps it's not the best sourced right now, but there are pieces of criticism published out there; let's hope more links will be added soon enough. One thing comes to my mind, Paul Graham's

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.

(from http://www.paulgraham.com/icad.html); perhaps the discussion at http://www.c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatures is a good start too. Dexen (talk) 16:50, 19 November 2010 (UTC)
As it currently stands the criticism section is based on irgnorance; it criticises the 'concept' of patterns. That is like criticising the 'concept' of solutions or answers to questions or formula. (Software/Design/Architecture) Patterns are solutions documentation in relativity consistent way. Individual patterns may be 'poor' or 'wrong' but that makes them anti-patterns or poor solutions, it doesn't make the concept of patterns wrong, if anything it justifies them further. MartinSpamer (talk) 07:22, 27 November 2011 (UTC)
Your phrasing seems to conform to the criticism that "design patterns" are hardly new. "That is like criticising the 'concept' of solutions or answers to questions or formula.". What /isn't/ a solution or answer? (Software) engineers as I understand them apply knowledge to solve problems. It follows then there have always been "design patterns" as long as there have been (software) engineers, and thus "design patterns" existed long before the Gang of Four. But maybe you mean something more specific than just knowledge. But then again, maybe not. A solution, good or bad, addresses some problem. Documentation records this solution in a form that can be transmitted to someone else. A "relatively consistent way" could in the extreme mean totally consistent, like some kinds of logic, or something totally free-formed, like some kinds of art (and yes, people have been inspired to create and document a solution based on an encounter with art). If these are "(Software/Design/Architecture) Patterns", then I claim first you are correct that "it doesn't make the concept of patterns wrong", for how can a concept be wrong?, and second, that one part of the criticism section is actually valid because the concept /of a concept/ is hardly new (though for a twist, our /concept/ of a concept has changed over time). In other words, the concept of "design pattern" seems to me indistinguishable from "knowledge", and could thus be stated as: knowledge is documentation of solutions in a relativity consistent way, and pretty much state the same thing. It's quite telling that you put all the adjectives to "patterns" in brackets, suggesting you don't mean just software design patterns, but patterns in general.
(GeorgePaci incidentally stated the same thing about another of Christopher Alexander's ideas, that "QWAN" was a replacement for "good" (… '"That design is good" and rewrites them as "That design has QWAN"'). The same thing here, where "design pattern" replaces "pattern" (or "concept")).
So that I'm not accused of something I didn't say, let me be clear that I too support the concept of documenting solutions in a relatively consistent way (and thus am against "inconsistency", meaning something like "undisciplined", or "ignores previous knowledge (re: patterns) without reason"). However, I don't think all this talk of design patterns has really added much, and perhaps nothing at all, compared to what we would have done had we not borrowed from Alexander's ideas. If he was the first architect to document (repeated) solutions, then good for him. If the Gang of Four was the first to document (software) engineers' knowledge, then good for them. Yet, I don't think that could be the case. That's not to say our ways of recording knowledge have never changed – they have. Rather, (design) patterns might better be thought of (and defined as, one step towards a good /concept/) as documentation to solutions in a /more/ consistent way, more consistent than whatever came before. On this view, a "design pattern" really just looks like a form of organized knowledge, as opposed to being scattered across a million brains and databases, much like Wikipedia is a form of organized knowledge compared to the millions of sources that is (supposedly) cites.
The bottom line is that I would drop all this design pattern talk because there already are burgeoning fields that talk about knowledge. For instance, cognitive scientists would talk about "mental representations", and could ask questions that design pattern people could not, like are some mental representations more "difficult" than others, such as, do they take up more processing time? This could then have relevance to software engineering because it could tell us, somewhat, if some "design patterns" give us more trouble than others). In other words, software design patterns (Gang of Four, Alexander's ideas, etc.) to me seem disconnected from the rest of our knowledge. This is a bad thing. If anything it justifies them less.
tl;dr: software design patterns have become indistinguishable from knowledge or concepts, and all talk of it can be done away with, but what it refers to cannot. KaiSeun (talk) 07:25, 16 February 2012 (UTC)

References

  1. Peter Norvig, in Design Patterns in Dynamic Programming, discusses the triviality of implementing various patterns in dynamic languages. Norvig, Peter (1998-03-17). "Design Patterns in Dynamic Programming". Retrieved 2007-12-29. Norvig and others have described language features that encapsulate or replace various patterns that a C++ user must implement for themselves.

Criticism

In the field of computer science, there exist some criticisms regarding the concept of design patterns.

Workarounds for missing language features

Users of dynamic programming languages have discussed many design patterns as workarounds for the limitations of languages such as C++ and Java.[1]

For instance, the Visitor pattern need not be implemented in a language that supports multimethods. The purpose of Visitor is to add new operations to existing classes without modifying those classes. In C++, a class is declared as a syntactic structure with a specific and closed set of methods. In a language with multimethods, such as Common Lisp, methods for a class are outside of the class structure, and one may add new methods without modifying it.

Similarly, the Decorator pattern amounts to implementing dynamic delegation, as found in Common Lisp, Objective-C, Self and JavaScript.

Many patterns imply object-orientation or more generally mutable state, and so are meaningless in functional programming style, in which data is immutable or treated as such. For example, the Iterator pattern is a generalisation of 'for' loops, an inherently imperative notion.

Does not differ significantly from other abstractions

Some authors [who?] allege that design patterns don't differ significantly from other forms of abstraction[citation needed], and that the use of new terminology (borrowed from the architecture community) to describe existing phenomena in the field of programming is unnecessary. The Model-View-Controller paradigm is cited as an example of a "pattern" that predates the concept of "design patterns" by several years.[2] It is further argued by some[who?] that the primary contribution of the Design Patterns community (and the Gang of Four book) was the use of Alexander's pattern language as a form of documentation; a practice that is often ignored in the literature. [citation needed]

Creating a new category

Should Multiton be listed?

See Also section

" types of design patterns" vs "classification"

design patterns vs algorithms

In Design Patterns/Code Complete - WTF

Related Articles

Wikiwand AI