Design Patterns

I just came across a blog entry by Mike (who I don’t know) about design patterns, which I found a very interesting read. The ensuing discussion in the comments section is equally interesting. I know enough about patterns to understand what they are talking about, but never bothered studying them closer.

The reason? A few hours into a week-long course on design patterns that I attended some years ago, I realized that I knew every single pattern the instructor was talking about. I just didn’t know that someone had given them a name.

There’s some use in those names, in that you can use them to communicate ideas. A code comment stating that you’re looking at an implemention of the observer pattern goes a long way towards helping you understand other people’s code. Provided you know what the term means.

On the other hand, I have to agree with commenter Ricky there that proponents of design patterns quite often advertise them as a goal, a holy grail, and not just one of several tools at your disposal. The singleton example he gives illustrates very well how design patterns cannot be viewed as a solution, when they can easily produce problems that you didn’t have without them.