Josh Bloch on the 15th Anniversary of Design Patterns
Josh is the author of many popular books, including Java™ Puzzlers: Traps, Pitfalls, and Corner Cases, Java Concurrency in Practice, and Effective Java, 2nd Edition.
Design Patterns is turning 15! My first recollection of the book is describing a neat hack to Doug Lea in 1997, and being told that I was using "the Decorator pattern." After getting over the initial disappointment of being scooped, I read the book, and was duly impressed. It was chock-full of good ideas—some new and others not-so-new. But more to the point, it gave us all a common vocabulary to discuss these ideas.
In recent years, design patterns have gotten a bad rap in some circles. For example, the Singleton pattern is said to increase coupling and decrease testability. But you have to remember that a design pattern is just a tool, and it's your responsibility as a programmer to use the right tool for the job. Every pattern can be abused or overused and doing so will harm a program, but that doesn't make the pattern any less valuable. Even the much maligned Singleton has many legitimate uses.
Another criticism you sometimes hear is that design patterns are merely workarounds for shortcomings in programming languages. A more charitable, and I think more accurate, view is that good ideas start life as coding patterns, mature over time, and eventually get incorporated into programming languages.
In 2001, I said that every programmer should own Design Patterns because it provides a catalog of useful patterns and a vocabulary to discuss them. It's as true today as it was then. Gamma, Helm, Johnson, and the late John Vlissides were pioneering lexicographers who changed the way we look at and talk about object-oriented software. Design Patterns was a signal achievement that has withstood the test of time.