> That would be because they (obviously) do exist.
Spot on. Now what? Well, you could for instance ensure that the most common patterns are as readable as possible. Most of the time, that means adding special support for them, or let the user write such special support.
Case analysis, for instance, is a pattern. Now you can implement it with nested `if`, or you can use a `switch` statement (if your language has either `switch` or macros). Personally, I prefer the `switch` statement, which at a glance makes clear what pattern is used.
GoF patterns are useful. The shame is C++ and Java's inability to properly implement them. Really, if you often use mixins, maybe you need closures. If you often loop over data structures, maybe you need `map` and `filter` (as closures or special syntax). And so on.
GoF patterns don't suck. They just highlighted how much C++ and Java sucked, by showing how much copy-paste you have to perform. In an ideal world, patterns would only be instantiated once: in the compiler or in a library.
Spot on. Now what? Well, you could for instance ensure that the most common patterns are as readable as possible. Most of the time, that means adding special support for them, or let the user write such special support.
Case analysis, for instance, is a pattern. Now you can implement it with nested `if`, or you can use a `switch` statement (if your language has either `switch` or macros). Personally, I prefer the `switch` statement, which at a glance makes clear what pattern is used.
GoF patterns are useful. The shame is C++ and Java's inability to properly implement them. Really, if you often use mixins, maybe you need closures. If you often loop over data structures, maybe you need `map` and `filter` (as closures or special syntax). And so on.
GoF patterns don't suck. They just highlighted how much C++ and Java sucked, by showing how much copy-paste you have to perform. In an ideal world, patterns would only be instantiated once: in the compiler or in a library.
On a related note, here is why I think C++ and Java suck, badly: http://www.loup-vaillant.fr/articles/classes-suck