4 ms·
I've written software over a decade and I loath the design patterns book. I would not give it to a beginner as it would corrupt their mind with useless drivel
by fsloth 8y ago
I've written software over a decade and I loath the design patterns book.
I would not give it to a beginner as it would corrupt their mind with useless drivel .
It's authors exhibit themselves as morons who celebrate renaming existing computer science concepts while occasionally mixing and matching them.
I would not be this uncharitable towards it if it was not such a famous (and hence harmfull) book.
It's harmfull because software engineering is really hard, and they just add up to the load by trying to have the reader memoize their junk instead of doing something that would actually make them a better programmer. And, if you try to use their concepts while programming - shudders, oh god help you.
I'm not going to iterate over every pattern. Here's an example:
Flywheight? You assholes, just tell memoization for what it is. Why don't you rename existing data structures as well? Good thing those come out of the box, otherwise you would have began the book by renaming array, linked list and dictionary. Maybe you would have called linked list "the chaingang" or something.
You don't simplify things by giving things cuddlier names. You stunt peoples growth that way.
Gang of four book is a malignant offshoot of the practice of attempting to make software engineering better by legalizing and dogmatizing it by decomposition into trivial details that hurt your brain. It's a branch of 'consultancy driven software development' where people attempt to aquire a halo of professionalism by calling things by fancy names and over-complex descriptions (while skipping the practical things with equally complex names but at least those weren't made up by a bunch of idiots).
- voltooid 8y agoYour comment is very interesting. I recently took a course on Design Patterns. I sat squirming during the lectures because I didn't like what was being said, but couldn't put my finger on what exactly I disliked. What I understand from your comment is that you dislike the Gang of four book because it renames concepts that don't need the cutesy names that they give them. Do you have a problem with the _concept_ of design patterns? Or just the names they are given? Are the concepts themselves sound and worth paying attention to?
- reacweb 8y agoI do not like the GOF book. Some of the patterns appears sometimes in my code, but the book has never helped me to program better or helped me to think about my code. The single benefit I got from this book is that it gaves me words to explain my code to other people.
- fsloth 8y agoI wrote a long rant as a response to another comment above. To quote myself: "It reads like it was written by a clever, verbose, and 'over-eager novice." Design patterns are a really usefull concept. The GoF book just totally botches up that concept by dwelving deep in trivial language details while missing the big picture. Christopher Alexander's "A timeless way of building", and "Notes on the Synthesis of Form" are the books in architecture that prompted a lot of dicussion in software design circles, and from which I presume GoF got their idea of software design patterns. What are good design patterns in software? IMO they are composed from the programming models exposed in a basic CS book like Aho and Ullman's "Foundations of Computer Science" and further developed in a books like Structure And Intrepretation of Computer Programs. GoF is an ok anecdotal reference after those, but it really is not suitable as a didactic resource. Peter Norvig wryly commented that 16 of the 23 pattern are either invisible or non-existent in lisp Lisp[0]. [0] http://www.norvig.com/design-patterns/design-patterns.pdf http://www.norvig.com/design-patterns/design-patterns.pdf
- beaconstudios 8y agoyour instinctual reaction against design patterns because you may have realised that design patterns are patches over flaws in the programming language's design - they're a terrible basis to build an architecture on. There's some discussion on this idea at the C2 wiki: http://wiki.c2.com/?AreDesignPatternsMissingLanguageFeatures http://wiki.c2.com/?AreDesignPatternsMissingLanguageFeatures
- jl2718 8y agoEverybody recommends it for no particular reason, and then I read one anonymous post ripping it apart in detail. I’m strongly inclined toward believing the latter and massively discounting most people’s opinion as unfounded, assuming they didn’t read it, and are just trying to convince others that they did. Is this the right way to think about this?
- rwnspace 8y agoBeing charitable, you could say at least part of the former are experiencing confirmation bias - that they enjoyed reading a different take on their existing knowledge - and cannot be arbiters of whether the book imparts anything useful to those without that knowledge.
- rhizome31 8y agoWhile 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.
- sonnyblarney 8y agoI disagree. Design Patterns are very useful, but they are a tool like anything else. They're not just a bunch of things with cutesy names, they are the most common and core patterns that we can use in OO. Yes, they are way overused, particularly in Java, but they are useful. The book could be summarized however.
- JanisL 8y agoThanks for this post, I remember reading about "Flyweight" and being confused at the time, if it's just memoization that instantly makes sense and is just such a better way of describing things.