I wouldn’t recommend the Gang of Four book. Many of the design patterns they espouse are way over complicated from the days of peak OOP. You know, FactoryFactoryVisitor stuff. Usually best avoided.
Agreed. And a lot of it is working around limitations of whatever version of Java was common at the time.
“Visitor pattern” is better implemented as an implementation of Iterator or whatever your language calls that. Everyone knows what “for x in thing” means, but wtf does it mean to “visit” something?
I’d say most of the GoF patterns evolved in a C++ toolchain (and then the Java junior devs started a cargo cult around them that has survived to this day). The book was never as language-independent as the authors envisioned it to be—in fact I’d argue that with the right programming language design the patterns happen implicitly or are obsolete.
I wouldn’t recommend the Gang of Four book. Many of the design patterns they espouse are way over complicated from the days of peak OOP. You know, FactoryFactoryVisitor stuff. Usually best avoided.
Agreed. And a lot of it is working around limitations of whatever version of Java was common at the time.
“Visitor pattern” is better implemented as an implementation of Iterator or whatever your language calls that. Everyone knows what “for x in thing” means, but wtf does it mean to “visit” something?
I’d say most of the GoF patterns evolved in a C++ toolchain (and then the Java junior devs started a cargo cult around them that has survived to this day). The book was never as language-independent as the authors envisioned it to be—in fact I’d argue that with the right programming language design the patterns happen implicitly or are obsolete.