James Edward Gray II wrote: > On Nov 14, 2009, at 8:56 PM, Marnen Laibow-Koser wrote: > >> This article is appallingly poorly thought out, and in any case only >> warns against using typed arguments (hardly possible anyway in Ruby) and >> using inheritance where composition was actually necessary (a basic OO >> analysis mistake). It brings little or nothing useful to the present >> discussion. > > I chose an example of the discussion. Unfortunately, it's a terrible example. A poorly reasoned, marginally relevant article from an untrustworthy source is not really going to convince anyone (at least, it shouldn't). I have been trying to read Rick's article, but it always seems to take forever to download. > It is in no way isolated. The > Gang of Four book is largely about avoiding inheritance. Really? My memory from when I read the GoF book is that many of the patterns (certainly not all) use inheritance as a basic building block. A check through the GoF pattern pages on Wikipedia, however, shows that I may be mistaken. Many of the cases I had remembered as inheritance are actually implementation of an interface, and most of the others are inheritance from abstract classes (which are sort of another kind of interface). Then again, while I appreciate the concepts inherent in the GoF patterns, I don't find those 23 patterns popping up all that much in the code I write. I wonder why. (For the most part, I don't deliberately try to code or refactor to GoF patterns, but if they want to emerge from refactoring, I certainly won't stand in their way.) > James Gosling > admits that he wishes he could do away with objects for typing in Java, > as the article says. You even stated that types aren't all that > important in Ruby, which I agree with, but that seems like and argument > against all of your examples that handle all typing with subclassing. Perhaps so. I like Ruby's duck-typing, but I don't seem to be willing to use it as a replacement for conventional inheritance. I seem to believe that it works best as a complement to a traditional type hierarchy. But these are semi-conscious attitudes. Maybe that means I don't know how to use duck typing properly. I have to think about this some more. > > Anyway, I've given examples and provided reference points. I hope I've > made my case. Now we're probably just bugging people, so I'm going to > let it go. What's to let go? I don't think we're off topic for the list... > > James Edward Gray II Best, -- Marnen Laibow-Koser http://www.marnen.org marnen / marnen.org -- Posted via http://www.ruby-forum.com/.