Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!m.cs.uiuc.edu!cs.uiuc.EDU!johnson From: johnson@cs.uiuc.EDU (Ralph Johnson) Newsgroups: comp.lang.smalltalk Subject: Re: Access methods - New feature ? Message-ID: <1991May1.042952.6876@m.cs.uiuc.edu> Date: 1 May 91 04:29:52 GMT References: <1991Apr21.221149.8057@vuse.vanderbilt.edu> <4753@m5.COM> <1264@argosy.UUCP> <4441.281d9cfe@iccgcc.decnet.ab.com> Sender: news@m.cs.uiuc.edu (News Database (admin-Mike Schwager)) Reply-To: johnson@cs.uiuc.EDU (Ralph Johnson) Organization: University of Illinois Lines: 32 Nntp-Posting-Host: m.cs.uiuc.edu I bet Allan and Kent were arguing about this back in 1986 or 1987 when they worked together at Tektronix. I take Kent's side, and argue about it with Allan when I see him. The claim that all variable access should be made through messages is nice in theory, but the current Smalltalk environment gives the advantage to directly accessing variables. I generally look down my nose at anybody who chooses Smalltalk programming style on the basis of efficiency, so I pay little attention to the relative speed of direct access or message sending unless I am optimizing a program. The reasons that I like direct access are because I think it makes programs a little easier to read and it is certainly a lot easier to figure out where a variable is getting changed by doing an "inst vars" than by doing a "senders". Thus, I think that direct access to instance variables makes programs easier to maintain. I don't buy the argument that Wirfs-Brock and Wilkerson made that it is easier to eliminate variables or to replace a variable with an algorithm to compute the value when all variable accesses are made using access methods. I have never seen an instance variable that I couldn't eliminate in 5 minutes using "inst vars" and intelligent cut and pasting. Of course, this is in Smalltalk-80. Perhaps the Smalltalk-V environment changes the balance of power. My argument (which is really the same as Kent's argument--I haven't said anything new) is based on the programming environment, not the programming language. This is a classic argument that never seems to end. It must be like the argument between vi and emacs users on Unix, a matter of taste. Ralph Johnson -- University of Illinois at Urbana-Champaign