Messaging vs. subroutines -- This is silly

Joachim Durchholz joachim.durchholz at munich.netsurf.de
Thu May 20 20:33:15 UTC 1999


Jim Benson wrote:
> 
> 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. [snip]

Right. So what?
A message is not a subroutine anyway (if I ever said that, please
attribute it to sloppy wording at late night).
A method is a subroutine.
A message send is a plymorphic selection, followed by a subroutine call
to the appropriate method.

> 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.

A single structure for each object *type* would suffice. It's painful
though.

> 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.

<tongue-in-cheek> If that's all, you might want to take a serious look
at C++. C++ does have dynamic dispatching and data encapsulation, and
both mechanisms work quite well. </tongue-in-cheek>
Seriously, the problems in C++ are elsewhere.

Regards,
Joachim
-- 
Please don't send unsolicited ads.





More information about the Squeak-dev mailing list