IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: Problems with patterns
Says JayMeghaffey:

A book about architecture can talk about "alcoves" and expect that the majority of readers will understand what is being talked about.


And what about "Wings of Light"? Will the majority of readers know what is meant by "Wings of Light"? What exactly is a "Cascade of Roofs"? There is a reason why I put seven examples on that slide, not one.



If it were as simple as you seem to think, Alexander would not have needed to write a book about it. He would just have printed up a list of 253 patterns and left it at that. The book is there to explain the patterns.




I think his complaint about iterators is misguided. The Iterator pattern is more general then ForEach.


Yes, I wasn't able to make the point as well as I wanted to there. That is one of the drawbacks of a five-minute talk. My real point is that many of these so-called 'patterns'---and the problems that they are intended to solve---actually result from defects in the source language. You may need an 'iterator' pattern in C++, but you need it much less in Perl, and hardly at all in Common Lisp. If you replace 'collection classes' with polymorphic arrays, you don't need 'iterator' objects because the state encapsulated by such an object is essentially a single integer.



Many of the 'patterns' in the GoF book aren't patterns of 'object oriented design' so much as patterns of working around defective languages. That's my thesis, anyway.



It seems a shame to spend so much time and effort in creating and studying a new field whose only purpose is to work around the defects of the awful programming languages we use. It would be a better use of time and effort to throw away C++; design patterns might still be a useful concept, but the patterns themselves could be a lot more powerful and sophisticated if we weren't always struggling with type systems and control structures that were thirty years behind the state of the art.



For more information about this, you may want to see [link|http://www.norvig.com/design-patterns/|Design Patterns in Dynamic Programming] by Peter Norvig. Says Norvig: "16 of 23 patterns have qualitatively simpler implementation in Lisp or Dylan than in C++...16 of 23 patterns are invisible or simpler." By 'invisible' Norvig means a feature that is "so much a part of [the] language that you don't notice [it]." As an example, he points out that C programmers have a pattern that might be called "encapsulated class". C++ doesn't have this pattern because when you want it, you just use the class keyword; the pattern has become invisible.



I'm also irritated at how the author of the presentation seems to have gone out of his was to be offensive.


You need to remember that the slides were not designed for consumption on the web; they were intended to accompany a five-minute talk that was given once. You are no doubt familiar with the idea that communications that might be polite or humorous in person become offensive or comfrontational in email. I think the same thing is happening here. What you perceive as offensive was intended, in the context of a five-minute talk at a Perl conference, to be irreverent and humorous, and I believe that it succeeded in that.



The only solution I can think of to this problem is to remove the slides from my web site. It's possible that this is the best thing to do.


--
[link|http://perl.plover.com/|Mark Dominus]
New Fixing existing languages...
... is necessary due to the exigencies of business software development.

Business decisions are made. Languages are chosen. Legacy systems and programming talent must be considered. If C++ is the language that must ("must", for sufficiently practical values of "might") be used, then I for one welcome anything, ANYTHING that makes using it easier or (flight of fancy) even fun.

If you are in a position to choose your language of development without such constraints, then by all means choose something that makes using such patterns invisible. I do so when I can. Programming for others, however, means that one must take into account pressures other than "it is easier for me to do it this way".
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Re: Problems with patterns
If it were as simple as you seem to think, Alexander would not have needed to write a book about it. He would just have printed up a list of 253 patterns and left it at that. The book is there to explain the patterns.

Naturally he has to explain the patterns, paritcularly since he was talking about using them with non-architects. It is my impression though that he didn't invent the patterns, he extracted architectual concepts and built a language that lets people talk about the concepts themselves. Having done that he can talk about how to mix and match patterns.

My point was that in computer science we have not even come close to pinning down the concepts that a language should be built around. We are still in the phase of extracting the concepts and putting lables on them. Until that is done to resonable level we can't talk much about higher level pattern usage.

My real point is that many of these so-called 'patterns'---and the problems that they are intended to solve---actually result from defects in the source language.

For the most part I agree with you here. I think some of the language specific patterns are not flaws though, just reflections of the differences between languages.

You need to remember that the slides were not designed for consumption on the web; they were intended to accompany a five-minute talk that was given once. You are no doubt familiar with the idea that communications that might be polite or humorous in person become offensive or comfrontational in email. I think the same thing is happening here.

I'm sorry, your right. Going back and looking again I can that a lot of what I saw as obnoxious might not have been taken as such by a friendly audience.

Jay
New Context shouldn't be C++
Although that was the prevailing language at the time of publication. I think we can all agree that C++ and its ilk (ie Java) are shitty languages with stupid complexities and limitations.

Of the GOF, 3 of them were focused on C++. Only Ralph Johnson is a Smalltalk guy. A number of the patterns are pointless in Smalltalk as well. For instance iterator - the collections do their own iteration via #do, #select:,#collect:, #detect:, #inject:into:, etc.

OTOH, a couple are pretty much Smalltalk specific (flyweight for representing characters as objects for instance).

I do agree with you that a number of patterns are designed to work around language stupidities. Some of the examples are done in a lame C++ oriented way too. Visitor, which is better known in the smalltalk world as double dispatch, is essential for making arithmetic come out correctly, but the way its explained is as a way to work around lack of runtime type information in C++.

Have you read the Design Patterns Smalltalk Companion? I haven't but a friend says the examples are much better.
The average hunter gatherer works 20 hours a week.
The average farmer works 40 hours a week.
The average programmer works 60 hours a week.
What the hell are we thinking?
New Re: Problems with patterns
I think some of the force of the presentation was lost, because C++ was the whipping boy of choice. It's a pretty low-level language, and finding problems with it is a bit too easy. A better idea, IMO, would be to look at large bodies of high-level-language code (like Smalltalk or Perl) and see what repetitive patterns emerge in those languages. After all, those languages already fixed the obvious problems in C and co. -- the question is what are the new bottlenecks?

New That is what Perl 6 is about :-)
Just today someone posted [link|http://www.perlmonks.org/index.pl?node_id=179555|this demonstration] (albeit with some minor errors since we don't have a Perl 6 implemention yet) of exactly how well the regular expression changes will remove existing parsing bottlenecks in Perl (which are shared by most scripting languages).

Cheers,
Ben
"... I couldn't see how anyone could be educated by this self-propagating system in which people pass exams, teach others to pass exams, but nobody knows anything."
--Richard Feynman
New Please don't remove the slides
I believe that they are valuable as they are. If I had not, then I would not have singled them out for discussion. But add a non-slide after, or else a blurb on your site's lead-in, that points out the circumstances, and links to a couple of more serious articles which make the same point.

Cheers,
Ben

PS I didn't know that you were aware of this site!
"... I couldn't see how anyone could be educated by this self-propagating system in which people pass exams, teach others to pass exams, but nobody knows anything."
--Richard Feynman
New Patterns and languages.
Why do you think that if a language supports a pattern seamlesly, that pattern is irrelevant in that language?

I think, the existance of foreach in perl and foreach: in Smalltalk is a testimony to relevance of iterator pattern. It's so important, it gets pilled into language's syntax.
     TPC slides are coming online - (ben_tilly) - (43)
         Problems with patterns - (JayMehaffey) - (42)
             Re: Problems with patterns - (Dominus) - (7)
                 Fixing existing languages... - (admin)
                 Re: Problems with patterns - (JayMehaffey)
                 Context shouldn't be C++ - (tuberculosis)
                 Re: Problems with patterns - (neelk) - (1)
                     That is what Perl 6 is about :-) - (ben_tilly)
                 Please don't remove the slides - (ben_tilly)
                 Patterns and languages. - (Arkadiy)
             The iterators complaint is truncated, not misguided - (ben_tilly) - (33)
                 Reusable components? - (wharris2) - (32)
                     Re: Reusable components? - (neelk) - (4)
                         Macros - (wharris2) - (3)
                             Not just macros! - (neelk) - (2)
                                 Re: Not just macros! - (wharris2) - (1)
                                     Re: Not just macros! - (neelk)
                     What "prevailing style of thought" are you talking about? - (ben_tilly) - (26)
                         Speaking for myself... - (tseliot) - (25)
                             Re: Speaking for myself... - (neelk) - (24)
                                 Paul Graham on OO - (tablizer) - (23)
                                     Note his first criticism - (ben_tilly) - (8)
                                         Elitist claim? - (tablizer) - (7)
                                             Don't guess, measure! - (neelk) - (4)
                                                 Simplify - (tablizer) - (3)
                                                     Re: Simplify - (neelk) - (2)
                                                         Depends on the language - (ben_tilly) - (1)
                                                             This is why I prefer PHP to C... :-) -NT - (static)
                                             You can judge that for yourself - (ben_tilly)
                                             You can judge that for yourself - (ben_tilly)
                                     HAS-A is orthogonal to OO - (admin) - (13)
                                         Guess you gotta... - (folkert) - (1)
                                             Muah. -NT - (admin)
                                         It is more common in OO - (tablizer) - (10)
                                             Don't go there. You will regret it. -NT - (static) - (1)
                                                 What is wrong with a little romp with a cute harmless troll? -NT - (tablizer)
                                             Been down this road before... - (admin) - (7)
                                                 Defining definition - (tablizer) - (6)
                                                     Mister... - (folkert) - (5)
                                                         Frameworks and votes - (tablizer) - (4)
                                                             Now... - (folkert) - (3)
                                                                 Erect Ape - (tablizer) - (2)
                                                                     Hey.. I feel the *same* way about the tyranny of - (Ashton) - (1)
                                                                         What we need are more DISorganized religions? Hmmm -NT - (tablizer)

Hello! Woody! Do you want join in vehement athletics?
583 ms