Messaging vs. subroutines -- This is silly

Jim Benson jb at speed.net
Thu May 20 15:43:34 UTC 1999


You folks are kidding about all this, aren't you?

A message is not a subroutine. E.G.

billy := 5.
billy printString.
billy := 'mary'.
billy printString.

How clever would a subroutine named printString have to be in order to order
to come up with different answers for each different type of object in the
system? A mighty big case statement, pardner. And we could use recursion too
for arrays and the such !!! Oh, and of course you would need to somehow
identify what type of 'object' that you are passing to your subroutine.
Using a language such as C, all you would have to do is create a different
structure for each object in the system for identification purposes. Or even
better, you could use constants or enums to define the object type being
passed to your printString subroutine. Of course, you would only need to do
this everytime you decide to use a messaging construct.

Maybe you can simulate some things that the messaging paradigm describes
with subroutines, Lord knows that they butchered C++ trying to do that. But
dynamic dispatching and data encapsulation is what makes Smalltalk
interesting to me.

Give me a break,

Jim Benson





More information about the Squeak-dev mailing list