misconceptions about patterns
I just read something called "Design Patterns" aren't by Mark Dominus. He seems like a smart guy, but he is missing the point. His main point is that "Design Patterns" claims to be inspired by Christopher Alexander but it really isn't in the same line at all. Christopher Alexander's work is profound, but Design Patterns is merely useful.
I just made up the line "Christopher Alexander's work is profound, but Design Patterns is merely useful", and am a bit proud of it. At the moment, I think it is true. I think Dominus would agree that it is good summary of what he was trying to say. However, I wouldn't agree with the way he said it. He mischaracterizes both Design Patterns and Christopher Alexander.
He says that " Everyone already knows that Design Patterns means a library of C++ code templates". Yes, some people think that. They are wrong. A design patttern is not a library of code templates in any language. If you use Design Patterns by copying code from the book then you are stupid and missing the point. The point of the book is to teach you to think. If you learn how to think about code then you will program better.
One of the reasons we included Smalltalk in the book was to show people that the ideas transcend programming languages. He uses Iterator as an example of how the book teaches people to copy and paste code. But we say that the exact interface of the iterator doesn't matter, that there are several ways to do it right, and that though you should probably pick a way and be consistent, there isn't a right way. We talk about iterators in Smalltalk and Lisp.
Alexander was an inspiration to Design Patterns. We didn't think we were creating a pattern language, but we felt like we might be taking the first steps toward one. We knew we were a long way from where we wanted to be. One of the things that has made me happiest about the impact of Design Patterns is how it has encouraged other people to write books, and many of them are closer to Alexander's vision than ours. In particular, I am rereading "Domain Driven Design" right now, and am once again impressed by Eric Evan's style. It is a great book, and is a lot closer to an Alexanderian pattern language than Design Patterns is. However, he probably wouldn't have written the book without the influence of Design Patterns.
Dominus says that Design Patterns is a catalog of designs that other people invented, while Alexander's vision of a pattern language is that people are supposed to invent patterns. Dominus is right about Design Patterns, but wrong about Alexander. Alexander is always talking about "discovering" patterns. He spent a large part of his life touring the world looking at buildings. He is not trying to invent new patterns, he is trying to capture the "Timeless Way of Building". Sometime people do invent new patterns, though until you get people to use them, you don't really know if it is a pattern. But Alexander, and the people writing patterns about software, are both trying to describe things that work instead of trying to invent new ideas.