4 ms·
While I agree that the GoF book is way overrated, I think you're being a bit harsh. Most of the patterns are actually tricks to overcome limitations of statical
by rhizome31 8y ago
While I agree that the GoF book is way overrated, I think you're being a bit harsh. Most of the patterns are actually tricks to overcome limitations of statically-typed class-based languages like C++ and Java. They can be useful in these languages but are not necessary with dynamic languages. Take Strategy for instance, with Python or JS, we'd just use a callback but in old Java you couldn't do that, hence the need for a more complicated technique. Creational patterns also mostly fall in this category. Some are so trivial (Template Method, Adapter), that it's hard to understand why they make them such a big deal.
Among the few patterns that are more generally useful and have stood the test of time, we'd find Composite, Command and of course Observer.
- fsloth 8y agoI wasn't harsh yet. While prompted by your comment, below I'm not directing any of this towards you but GoF book the icon. Excuse the rant. "Composite, Command and of course Observer" Each of which is trivially obvious way to structure your program when that need arises. You said it the best - GoF tried to attack a very real problem - the unwieldiness of C++ and Java - but they did really not come up with any actual solutions. And they extend this non-value-adding gibberish into a tome, that somehow has become a cultural icon of some sort. The basic premise of the book is this: "We looked out how people use object oriented languages and found this and this and this". Congratulations. By that approach they've enumerated a bunch of gobbledygook. They've not invented anything new. Nor have they done any deep analysis of the fundamental underlying concepts, and by their chosen approach I'm taking a guess they would lack the capacity to add anything of value to that discussion if they tried. Which is totally ok, most people, like me, are mediocrities. Reading gang of four is painfull, because it reads like the work of a very clever first year CS student who is over eager to create contrived examples of these nuggets of things he has discovered among the work of his fellow first year CS students. Without actually bothering to do a literature survey, or - most critically writing any massive programs or doing any complex abstract work of any worth. In other words, it reads like it was written by a clever, verbose, and over-eager novice. As an excuse, it was written in the dark ages in the 90's - a period of large scale communal lobotomization and attempts to forget the lessons of history. As such I would not judge it too harshly, if not for the fact that people keep bringing it up as some sort of book of actual wisdom like Structure and Interpretation of Computer Programs - which it really, really, really is not. The last reason why I don't like GoF book: In their title they steal Christopher Alexander's notion of Pattern Language in architecture, and totally and completely misapproriate it. Christopher Alexander's books are totally awesome. "Notes on the Synthesis of Form" and "Timeless way of building" are really beautiful books for anyone to read who has to design complex systems. Christopher Alexander's patterns are not piecemeal lego parts you can put together - they describe parts of a whole and each pattern is a composition of elements that - and this is the key part - fits to it's surroundings and the design constraints of the original problem to be solved. Gof book is borderline clueless, it confuses people, and it mis-introduced a totally awesome concept from another domain, thus effectively squatting on the concept and hindering any attempts to use those concepts in discussion of systems design since when you say "patterns" in CS context people automatically context switch to the GoF bastardized definition of the concept.