Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!m.cs.uiuc.edu!ibma0.cs.uiuc.edu!cs.uiuc.edu!voss From: voss@cs.uiuc.edu (Bill Voss) Newsgroups: comp.lang.smalltalk Subject: Re: Access methods - New feature ? Message-ID: Date: 24 Apr 91 01:18:29 GMT References: <1991Apr21.221149.8057@vuse.vanderbilt.edu> <1991Apr23.010026.25098@ccs.carleton.ca> Sender: news@ibma0.cs.uiuc.edu Organization: Typed Smalltalk Group, Dept of Comp Sci, Univ of IL in Urbana. Lines: 31 In-Reply-To: voss@cs.uiuc.edu's message of 23 Apr 91 19:44:35 For some reason GNUS/nntpd keeps dropping the tail of my posting with the message "writing to process: no more processes, nntpd" So here is that final section, ONE MORE TIME. -Bill ------------------------------------------------------------------------------- The next obvious question is "What do you do instead?" ;-) So glad you asked. ;-) It is my contention that instead of using something like x1 <- point x. y1 <- point y. anObject myThingX: x1 Y: y1. or in one line anObject myThingX: (point x) Y: (point y). in those cases where you legitimately need to know x and y, outside of Point, you should instead write a Point method: doMyThingOn: anObject ^anObject myThingX: x Y: y. I consider this CLEANER, more READABLE, more MAINTAINABLE, and much harder to abuse than a straight ACCESS technique. The fact that it usually involves both less programmer typing, and fewer runtime message sends is a nice bonus. -Bill Voss