[Cuis-dev] Generality number vs Double dispatch

Ces VLC cesarillovlc at gmail.com
Fri Jan 1 09:52:19 PST 2021

Hi again!

Being completely new to Smalltalk, I learnt about the "double dispatch"
technique yesterday, and my first reaction was that I felt quite
disappointed, because everything I was learning in Smalltalk was clean,
tidy, and efficient, ...until I read about double dispatching.

Then I searched the Blue Book for double dispatching and found zero
matches. Then I learnt Smalltalk-80 used "generality numbers" instead of
double dispatching. With a bit more of searching, I found Cuis uses double
dispatching because that change was done in Squeak by Ingalls time ago.

When reading the "generality numbers" approach in the Blue Book, I don't
feel disappointed at all: it looks to me like the clean and obvious
solution to the problem (ie: binary operators should be legal for objects
of the same class only, and trying to perform a binary on different classes
should trigger an error... however, if for some reason you want Smalltalk
to do the conversion for you, the generality number approach doesn't break
tidiness and pure design).

But I have a question, though: Did any of you have a long experience with
Smalltalk-80 and found the generality number technique to be a limiting
factor? I mean: Were your applications worse written (ie: with worse
design) because of not having double dispatch?

I'd like to check whether Smalltalk without double dispatching is worse
than with it, or not.

Thanks a lot,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210101/7bc769de/attachment.htm>

More information about the Cuis-dev mailing list