Alright, I admit it.
I preferred Head First Design Patterns to theGoF book (Design patterns : elements of reusable object-oriented software)
.
I read Design Patterns after the Head First book, expecting to get a lot out of the terse technical manual, and whilst I did learn from it and would not class the time I invested as waste, I was sourly dissapointed. Perhaps this just goes to show what a decent job of refining all the information into key points and diagrams Head First Design Patterns does, but there was really wasn’t a huge amount to be said over and above this in the GoF book.
I’m not saying that either book is superior – this preference certainly reflects my learning style more than it does the quality of either book. I also realise that Design Patterns resulted in some big advances in object-oriented programming in general, and without it Head First Design Patterns would never have come into being. However, I hope that if you’re looking for an initial insight into patterns you’ll get some benefit from my overview.
Like many aspects of the two books, the examples were near polar opposites. Whilst Head First Design Patterns offered real world situations to demonstrate each pattern (a pizza factory, for example), the GoF book used more technical problems, sometimes requiring several pages of explanations just to explain the specifications and constraints of the example. Although it can sometimes be ever-so-slightly more challenging to take the Head First examples (especially that make use of Java specific features) and consider them in terms of another situation, using the examples helped me both to remember the pattern (“Decorator? Oh, that’s right, it’s why rubber ducks can’t fly”) and to understand their utility in the first place.
Head First Design Patterns is all about retention. It has as many pictures as it does paragraphs, and curious but apparently effective additions like crossword puzzles. As a “visual learner” who lives through a series of diagrams – this is a dream. I’m not saying I could recite the book word for word, but I do think this helped me to understand and remember a lot of what was said. For a more experienced learned who’s used to picking up a pencil, making notes, and relating bodies of texts to something they can remember more easily, the GoF book may well be a better bet.
Design Patterns is technical. Honestly, I think I might have struggled if it had been the first book on patterns I read – the beginning chapter looking at Tex would intimiate all but the most determined students. However, although I said I didn’t gain a huge amount from Design Patterns over Head First, I certainly did gain something. The insights it gave, like suggestions that one pattern might be used in conjunction with another, are genuinely useful additions to the core knowledge I picked up from the ever-so accessable Head First book.
So in conclusion, what would I recommend?
Well, Head First Design Patterns is fantastic. Even if you’re initially put off but the casual format, I’d urge you to go on. It will quickly give you a great overview and an easy road into design patterns. Then, once you’re hooked, go on to look at the GoF book. It isn’t quite as scary when you’ve already decided patterns are the best thing since sliced cake (both in limited quantities, of course) and it does give a more in depth understanding of patterns, even if it’s not quite as much additional information as I was originally hoping.