M. Edward (Ed) Borasky said:
Well ... I have the book. I'm totally unfamiliar with the GoF book. I
know it's a classic, but I've just never gotten around to learning
design patterns. So I got the book and I like it. If you're already an
expert on design patterns from another language, for example, from "Head
First Design Patterns" (Java) I rather doubt you'll learn anything from
this book that you don't already know. But for me, it's exactly what I
need.
Far be it for me to disagree with someone who seems about ready to buy
my book, but... oh well.
You see, I think that if you picked up a book on design patterns in Java
on your way to writing a program in Ruby, you will be making a serious
mistake. As others have pointed out, Ruby is different from Java and the
other traditional programming languages in some serious ways: open
classes,
and dynamic typing to name just a couple.
What I did in the book was to stand back and look at each pattern and
ask
a couple of questions: "What problem is this pattern trying to solve?"
and, critically, "How do people typically solve this problem in Ruby?"
Turns out that sometimes the Ruby solution is pretty much the same as
the Java solution. A Composite in Ruby is pretty much the same as a
Composite in Java. But for many of the patterns - here Commands and
Iterators come to mind - the Ruby solution is radically different
than the Java solution. Why? Those are the kind of questions that I
tried to answer in the book.
One of the nice things about Ruby is that many problems are much easier
to solve. The last thing we need is folks writing Java or C# code in
Ruby. We need people writing Ruby in Ruby.