Wed, 04 Oct 2006

On Design Patterns.

picture of book

The book "Design Patterns : Elements of Reusable Object-Oriented Software" by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides is one of the most well known books about the concept of design patterns ; the idea of codifying generic solutions to recurring programming problems. The book is so well known that the authors came to be dubbed the Gang Of Four. When programmers talk of the Gang of Four they are usually talking about this book and these authors.

Unfortunately, even though I do own a copy I simply haven't managed to find the time to actually read it. As a coder whose two favorite languages are Ocaml and C this book is not directly applicable to my coding in those languages, especially since I rarely feel the need to use Ocaml's OO features. However, I do code in C++ and Python, both in my own time and at work and I suspect that reading and understanding this book would help my coding in both those languages.

So while I may not have read the actual book I do like to read articles and blog entries about the book. One that recently came to my notice was an article by Mark Dominus which spawned a response from one of the Gang of Four authors which in turn spawned another article from Mark Dominus.

Mark Dominus' original article and his follow up suggest that design patterns arise to make up for weakness in the languages they are implemented in. In particular, patterns that exist in one language may disappear completely in a more advanced language which replaces the pattern with something far more simple and not worthy of being called a "pattern".

I really do hope that I find time to read the book because it will be interesting to make up my own mind on this issue. It will be especially interesting to see how many of the patterns in this book apply in Ocaml.

Posted at: 22:18 | Category: CodeHacking | Permalink