From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b50bc6538a649497 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-11-09 18:09:19 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!nntp.flash.net!news.flash.net!not-for-mail From: "Ken Garlington" Newsgroups: comp.lang.ada References: <3A02CED4.520C2768@brighton.ac.uk> <3A078B6F.D34B024B@erols.com> <8ua3m1$bru$1@nnrp1.deja.com> <3A09A39F.2822C01B@cepsz.unizar.es> <8udce8$1qi$1@nnrp1.deja.com> <8ufd4n$obj$1@nnrp1.deja.com> Subject: Re: if statements X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Fri, 10 Nov 2000 02:09:17 GMT NNTP-Posting-Host: 216.215.65.89 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 973822157 216.215.65.89 (Thu, 09 Nov 2000 20:09:17 CST) NNTP-Posting-Date: Thu, 09 Nov 2000 20:09:17 CST Organization: FlashNet Communications, http://www.flash.net Xref: supernews.google.com comp.lang.ada:1974 Date: 2000-11-10T02:09:17+00:00 List-Id: "Robert Dewar" wrote in message news:8ufd4n$obj$1@nnrp1.deja.com... : > Actually, I would also nitpick the choice of "Temp," when : > better options are available (Initial_A, or the really : > expressive Initial_Value_of_A). : : I disagree, this is long-nameitis carried to absurd extremes. : Rewritten the way I had it the life time of Temp is three : lines and it is obvious that it is initialized with the value : of A. It merely obfuscates code to use long names where they : do not help the reader. I actually think a more appropriate : choice of name would have been T :-) However, it's obvious it's "temporary" (i.e. has a limited scope) just from where it's declared. The name doesn't add any value. I think what you may actually be saying is that "everyone understands the pattern for swapping two variables, so there's no point in worrying about the name." I would have agreed with this, EXCEPT for the earlier post in this thread* that indicated that beginning students DIDN'T always grasp the "obviousness" of this pattern. Therefore, for those people, Initial_A may be worth the five extra keystrokes. * I'm referring to the discussion about wine and beer, which for some reason I was able to remember :) P. S. Here's how I would explain the swap pattern: "Imagine picking up two very large steins of beer. Now, think about having to exchange the two steins between your left and right hands. You probably have to put one of the steins on the table, move the other stein from one hand to the (now-empty) other hand, then pick back up the first stein from the table. 'A' and 'B' are your hands, 'Temp' is the table."