Yes We Have No Panaceas
The software development profession can be scary sometimes. While there seem to be no silver bullets, there are definitely a few werewolves roaming around. The good news is that they can be subdued, through a combination of non-magical skills and strategies. The bad news is we tend to forget that, and we start believing in silver bullets once again. In more prosaic terms, successful software development depends on the application of partial solutions, the only kind of solutions we really have. We get into trouble when we start believing in panaceas. It is a lesson our industry seems destined to learn again and again.
Design patterns are an excellent example of a partial solution. They promote a unique kind of reuse, not so much of code as of forms, specifically architectures and patterns of interaction. Properly applied design patterns promote clarity in both design and in technical communication. Improperly applied patterns yield troublesome designs ones that are flawed but appear to have the stamp of authority. Perhaps the most common mistake with patterns is confusing a sample implementation with the pattern itself. If the implementation is bad, we say the pattern is bad. Or worse, we say the implementation must be okay because it is a pattern, and everyone knows patterns are cool. Another common mistake is viewing patterns as components, to be "plugged into" an application. Patterns shape applications; they cannot be plugged into them any more than a blueprint can be plugged into a house. Ironically, our training in OOP predisposes us to this mistake, because it encourages us to "think modular." Encapsulation is a habit that has served us well it just doesnt work so well when thinking about patterns.
For people who put stock in Jungian psychology, this issue of CUJ fairly resonates with synchronicity. No less than three articles demonstrate the application of design patterns. Whats more, each of these articles shows how to combine two or more patterns to achieve a better solution. I think these articles demonstrate an appropriate approach toward patterns. The authors do not wave them around like some sort of magic wand. They use them as a guide that increases the order and clarity of their code.
On another note, I want to make amends for a serious oversight in last months editorial. When I introduced Andrew Koenig as our newest columnist, I gave extremely short shrift to his co-author and wife, Barbara Moo. That is to say, I did not mention at all that she would be regularly collaborating with Andy on their "C++ Made Easier" column. I confess I did not realize this I may have dropped an email in the hubbub of the past few months, or maybe I am finally going senile. At any rate, I want to point out that, like Andy, Barbara comes to us with many impressive credentials. She has been in the software field for two decades. Among other things, she managed AT&Ts first C++ compiler project, and she has co-authored two C++ books with Andy. We are very happy to have her aboard. Please give her a warm welcome.
Marc Briand
Editor-in-Chief