::scr Touchy Feely?

Simon Kinahan scr@thegestalt.org
Thu, 24 Oct 2002 11:40:41 +0100


> That's why I think the Design Patterns book was so important.

Yes indeed. It marks a real turning point in the history of object
orientation. Before the patterns book, people trying to learn how to do
things the OO way were stuck with the really bad examples that appear in
most textbooks. Even very smart people like Grady Booch and Bertrand Meyer
used to write books where they'd explain that an object is really like a cat
(no, really - because all the cats innards are inside its skin), or use
little animal taxonomies as examples of class hierarchies. So the world was
divided into people who realy understood OO, who mostly used Smalltalk and
Common Lisp, and people who tried to understand it, got misled by all the
bad writing and boosterism, decided it was rubbish, and mostly used C++.

Since the patterns book, people have started writing stuff about how to
really use OO languages - especially polymorphism - to solve actual
engineering problems. I think that before, there was a lot of guilt around,
because everyone saw that the "software crisis" was real (and it still is -
there is no silver bullet, remember), and that OO, or some more abstract
technique, could help, but when they tried to apply it to real problems,
they couldn't see how. People obsessively tried to hide the internal state
of their classes, found they didn't work, and then made all the instance
variables public[1]. They got stuck on the billiard table problem (if I want
to model hitting a billiard ball with a cue, is that behaviour on the cue,
the table, or the ball ?), and ended up with global functions. The pattern
book was the first book I am aware of that set the hokey religious revival
one-liners of OO to one side and actually showed how to do useful stuff.

> For me at least, it has helped to formalise some concepts in my head,
> some of which I had seen or used before, but many of which I didn't have
> names for.

I find I tend to use the patterns in two ways. By far the most common is
that I'm doing something in a particular way, and I notice (or someone tells
me, more likely) that it looks like a particular pattern. That is useful to
know, because if I try to make it closer to pattern, it usually gets better,
whereas if I diverge from it it usually gets worse.

Very occasionally, I actually consciously look at the patterns book to get
some inspiration on how to solve a problem what seems confusing or messy.

Simon

[1] This seems to be getting excessively Freudian ...