I'm Ready For My Close-up, Mr. Demille
Posted by Rick DeNatale Tue, 22 Aug 2006 15:37:00 GMT
Back when I was younger, and object[-oriented] programming was fairly new, my colleagues and I seemed to spend a lot of time philosophizing about types and objects. Although I don’t remember talking about ducks, we did talk a lot about the theater. The most common word we used to use for what we now call a duck type was a role.
Another way of looking at this, is that duck typing is akin to the way a person is chosen to fill the role of the American President. An assessment is performed on the candidates,one is chosen, and then the country, and world adapt.
Contrast this to the way things are done in picking the next British monarch, or the type systems of C++ or Java. In both cases one has to be born into the role, having the right genes via inheritance. Of course in the first case, who gets the job doesn’t matter all that much anymore.
Recently a thread about patterns on the ruby-talk mailing list turned, as threads there are wont to do, to duck-typing.
Read more...








