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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,ea99940253996e3e X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,ea99940253996e3e X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,ea99940253996e3e X-Google-Attributes: gidf43e6,public X-Google-Thread: 108717,ea99940253996e3e X-Google-Attributes: gid108717,public X-Google-ArrivalTime: 2003-10-24 04:55:21 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer00.lnd.ops.eu.uu.net!lnewsinpeer00.lnd.ops.eu.uu.net!bnewsoutpeer00.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read-nat.news.nl.uu.net!not-for-mail From: "Stephen Baynes." Newsgroups: comp.software-eng,comp.programming,comp.lang.c++,comp.lang.ada References: <2cfd1a4e.0309252032.3e3c0a1a@posting.google.com> <863cefjy6l.fsf@strudel.futureapps.de> <86ad8i7d1d.fsf_-_@huldreheim.huldreskog.no> <86zngh5oct.fsf@huldreheim.huldreskog.no> <86r81s6elg.fsf@huldreheim.huldreskog.no> <3F830C63.1070005@crs4.it> <3F8BFCF5.6020906@crs4.it> <3F93925F.5060808@crs4.it> Subject: Re: Spell-checking source code Date: Fri, 24 Oct 2003 12:55:18 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: <3f991327$0$260$4d4ebb8e@read-nat.news.nl.uu.net> NNTP-Posting-Host: ehv02e.pixs.philips.com X-Trace: 1066996519 read-nat.news.nl.uu.net 260 193.67.187.140 X-Complaints-To: abuse@nl.uu.net Xref: archiver1.google.com comp.software-eng:20871 comp.programming:1632 comp.lang.c++:3908 comp.lang.ada:1593 Date: 2003-10-24T12:55:18+01:00 List-Id: "Jacob Sparre Andersen" wrote in message news:3F93925F.5060808@crs4.it... > Jakob Bieling wrote: > > [ abbreviated identifier prefixes ] > > > Not sure where I picked that habit up, but I guess it is pure laziness. > > I could not imagine having to type those long names everytime you use them. > > Well. I tend to read code more often than I write it (even my own), and > most of my time is spent thinking about what to write, so saving a few > keystrokes really doesn't make sense to me. > > > Especially counter variables in for-loops (posting from comp.lang.c++) .. > > you also use simple i's and j's etc. there, right? > > No. (unless it is for matrix and tensor manipulation, where the > "documentation" actually says "i", "j" and "k") To me the length of the name should reflect the size of the scope. A one letter variable name is fine for the counter in a very short for loop, or a temporary that is only used for a couple of adjacent statements. But if the variable is used over many lines a longer more meaningful name is required. Global variables tend to end up with the longest names as they have to be used and understood in many more contexts. Like all rules - there are exceptions. In particular if something is used very frequently then a shorter name is desirable for convenience and acceptable as it will be well known and understood. [eg 'stderr'] -- Stephen Baynes CEng MBCS My views are my own