3 ms·
The value of the GOF book is in the way of thinking, not in the actual patterns themselves.
by radicalbyte 15y ago
The value of the GOF book is in the way of thinking, not in the actual patterns themselves.
- BerislavLopac 15y agoI was seriously disilusioned when I have learned that most of the design patterns make sense only in strongly-typed languages, and that the whole mess that is abstract factory can in, say, PHP be replaced with a simple new $className();
- gtrak 15y agoBut then you realize, some people can only barely decipher what's printed on the pages, they consider it a bible, when it is in fact, a consequence of design compromises in pseudo-OOP langs like C++ and java. I really really hate singletons, visitors, factories, and all the lot, but I'm glad I can understand the intent of these things. I think being disillusioned with this book is a good stepping stone for devs, it felt like one to me.
- famousactress 15y agoI'm not sure I agree. I suspect the vast majority of them (including abstract factories) make loads of sense in most languages.. it's just that strongly typed languages make many of the patterns complicated enough to implement that they deserve a chapter's worth of description.
- apu 15y agoYes. See Peter Norvig (Director of Research at Google)'s slides on this topic here: http://norvig.com/design-patterns/ http://norvig.com/design-patterns/
- InclinedPlane 15y agoVery much so. However, it's much less successful at instilling that way of thinking than Refactoring is. Worse yet, many readers becomeoverly enamored with the "canonical" design patterns, seemingly not realizing that most of them are special purpose constructs and only useful in very specific circumstances (and in some languages wholly obsolete). They also often don't understand that those examples are but a drop in the bucket amongst the universe of useful patterns (many of which assuredly haven't even been created yet).
- radicalbyte 15y ago>Very much so. However, it's much less successful at instilling that way of thinking than Refactoring is. That's why I like PoEAA - Fowler is better writer than the GOF so his books do a better job of bringing the ideas across.
- famousactress 15y agoSomeone once told me that the value of the GOF book was that it provides a common vocabulary for shared ideas. I believe that now. That's what (and maybe all) it's good for in my mind. The problem with using it to impart a method of thinking in my mind is that the way of thinking (and the patterns themselves) really have to be earned. I think it's possible for a book to do a fair job at imparting that wisdom, but GOF is setup terribly for it. It's sort of like picking up a recipe book full of classical french dishes without learning about french cooking first. It's too easy to misunderstand the specific values and compromises of specific 'ingredients' and undo the benefit the pattern could provide altogether. I've wondered before if GOF could be rethunk with Refactoring in mind. Starting with code smells is exactly right. The book should focus more on identifying problems with an approach, because that's the hard part. Solutions are much easier.