Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!howland.reston.ans.net!nntp.crl.com!pacbell.com!amdahl.com!amd!netcomsv!uucp3.netcom.com!slcgate!servio!servio!aland
From: aland@servio.slc.com (Alan Darlington)
Subject: Ok to use #perform:? [was Re: TopHat new -- Smalltalk With Style]
Message-ID: <1995Jul31.210415.28910@slc.com>
Sender: news@slc.com (USENET News)
Nntp-Posting-Host: servio
Organization: GemStone Systems, Inc., Beaverton OR, USA
References: <n1405356834.85007@smtpgwprod.ny.jpmorgan.com>
Date: Mon, 31 Jul 1995 21:04:15 GMT
Lines: 38

"Alvarez, X." <alvarez_xavier@JPMORGAN.COM> writes:
<snip>
>> 4) I thought they got a little bit dogmatic at a few points, maybe
>> from lack of space to explain their guidelines.  E.g.  p.  102 they
>> strongly warn against use of #perform:  but they never say why (I
>> guess I can figure out why, but they might have said.)
>> 
>> Jeff Rensch, STanford ITSS
> 
> Why do you think #perform: shouldn't be used?
> 
> I'm not pulling you on this one, it's just that I find it pretty convenient
> to use it in some things that I'm doing...
> 
> Besides, without the ability to use the #perform: Smalltalk looses some of
> the dynamism that it's capable of!
> 
> Just wondering...
> Xavier

One of the nice features of Smalltalk is the ability to find out who
uses a method (i.e. "senders" of a message).

#perform: is often used to implement configurable objects - you stuff
your selector symbol into an object's instance variable, and the object
performs it when necessary.

While this is nice, you now have a much more difficult time tracking
down those methods which "really" call a given selector.  This makes
an application more difficult to understand and maintain.  (Vendors
could help by extending "senders" to report methods which use the
selector symbol in any way - such as within constant arrays stored in
a method's constant pool - but this is a different problem... :-)

Alan
(standard disclaimer)


