Another Take on Design Patterns

Posted by Rick DeNatale Tue, 19 Jun 2007 20:48:00 GMT

Most programmers these days are familiar with, or at least aware of the now classic “Gang of Four” book Design Patterns: Elements of Reusable Object-Oriented Software.

One of the recurring arguments about design patterns is how they relate to individual programming languages. The “Gang of Four,” Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, were by majority, proponents of strongly typed languages. Ralph was the sole representative of Smalltalk and the rest of the dynamic object oriented languages. As a result, The GOF book had and has more resonance with the C++ community and it’s successors. Although there are some Smalltalk examples in the book, many of the patterns express things which are easier, and in some cases unnecessary to express in a dynamically typed language. I find this a bit ironic, since the whole patterns movement seems to have started when Ward Cunningham and Kent Beck, two of the best known Smalltalkers, discovered the work of architect Christopher Alexander and thought that his approach to building and municipal design could be translated to the design of software.

As I was browsing today, I was reminded that there is another “Design Patterns” book, “The Design Patterns Smalltalk Companion” by Sherman Alpert, Bobby Woolf, and Kyle Brown. Which might be of interest to not just Smalltalkers but also Rubyists, since it approaches the subject from they dynamic language point of view. It’s not easy to find, but Amazon has a few copies in stock.

Sherm was one of the researchers in the IBM User Interface Institute which was housed in the same building where John Vlissides and Richard Helm of the “GOF” worked, the IBM Watson Research center in Yorktown Heights, NY. I spent quite a bit of time with Sherman and the rest of the UI institute team under John T. Richards back in the late-1980s to early 1990s. Bobby and Kyle were OO consultants, who I also knew through Knowledge Systems Corp.

You never know what you might learn from the old Smalltalkers.

Posted in , ,  | Tags , , ,  | no comments | no trackbacks

Die Hard?

Posted by Rick DeNatale Tue, 12 Jun 2007 15:24:00 GMT

At the last meeting of the Agile RTP group, I won Michael T. Nygard’s book Release It! which I’m reading as a background task. This morning I ran across this:

Interpreted languages such as Java and Ruby almost never crash. Sure they get application errors, but it’s relatively rare to see the interpreter or virtual machine crash. I still remember when a rogue pointer in C could reduce the whole machine to a navel-gazing heap.

I remember “back in the day” when there were endless arguments between the C++ and Smalltalk advocates. The C++ folks would often quote Bjarne Strroustrup’s fear of flying in an airplane whose flight control system was written in Smalltalk, and threw a “message not understood” exception.

Those of us in the Smalltalk camp found this amusing, since the alternative was a system crash caused by an invalidpointer.

Now maybe Nygard framing rogue pointers in C as a memory means that the problem has been solved, but I seem to recall having seen it recently.

It’s Not Just The Language Stupid

One point here is that pet-features such as strong vs. dynamic typing or garbage collection vs. allegedly more performant[1] manual memory management aren’t panaceas. They can have a major effect on aspects such as easo of development, or tweaking out the last bit of performance, sometimes in non-intuitive ways.

Making robust software requires more than just choosing a language, it requires craftmanship, adherence to best practices for the chosen language(s) and technologies, and a realistic understanding of the challenges at hand.

Release It!

And that’s where we come back Nygard’s book. Although I assume that most of my readers are Rubyists, and Nygard is a Java guru, there is much of value here for anyone concerned with producing robust software that can stand up to the real world.

Based on what I’ve read sofar, and skimming the rest, I can recommend it. If you’re interested you can buy it directly from the Pragmatic Programmers, or via the amazon.com link. The later would help feed the duckdogs who run this site, and lower my distraction from their gowling stomachs.

[1] The “allegedly” will no doubt be explained in further posts here.

Posted in , ,  | Tags , ,  | no comments