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: f43e6,ea99940253996e3e X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,ea99940253996e3e X-Google-Attributes: gid103376,public X-Google-Thread: 108717,ea99940253996e3e X-Google-Attributes: gid108717,public X-Google-ArrivalTime: 2003-10-20 00:44:51 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!newsrm.news.garr.it!NewsITBone-GARR!newsfeed.cineca.it!newsserver.cilea.it!news.crs4.it!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.software-eng,comp.programming,comp.lang.c++,comp.lang.ada Subject: Re: Spell-checking source code Date: Mon, 20 Oct 2003 09:44:31 +0200 Organization: CRS4, Center for Adv. Studies, Research and Development in Sardinia Message-ID: <3F93925F.5060808@crs4.it> 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> NNTP-Posting-Host: sparre.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: pietro.crs4.it 1066631357 26099 156.148.70.170 (20 Oct 2003 06:29:17 GMT) X-Complaints-To: news@nntpserver.crs4.it. NNTP-Posting-Date: 20 Oct 2003 06:29:17 GMT User-Agent: Any Browser, HTML 4.01, XHTML 1.0 X-Accept-Language: fo, da, no, sv, is, fr, de, it, In-Reply-To: Xref: archiver1.google.com comp.software-eng:20831 comp.programming:1220 comp.lang.c++:3136 comp.lang.ada:1185 Date: 2003-10-20T06:29:17+00:00 List-Id: 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") > As you seem to be posting from comp.lang.ada, Well. There and "comp.software-eng". > I am not too sure if Ada provides such constructs in the > same way C++ does, so maybe Ada has different means of looping in a > for-loop-kind-of-way (yes, I know pretty much nothing about Ada). The Ada for loop is not as flexible/error-prone as I remember the C++ for loop (which I haven't had to use for years :). A quick example: for Day in Monday .. Friday loop Put (Day); Put_Line (" is a workday."); end loop; (where I assume I have declared an enumerated type based on the days of the week). The counter variable is created by the for loop statement, so you don't have to worry about making an explicit declaration of a variable for use as the counter. I seem to remember that you have to have an explicit declaration of the counter variable in C++, which of course makes a slight difference. > Also, sometimes I tend to abbreviate quite a lot, so that later I might > not know what it stands for. Not good. That costs time and is a potential source for errors if you misremember the meaning of the abbreviation. > In cases like those I just put a comment next > to where I declared the variable and I can keep saving those keystrokes. I consider that a misuse of comments. I see comments as a means for expressing what _can_ not be expressed in actual code. Otherwise you risk ending up with code and comments that say different things. One result of this view is of course that it differs from language to language, what are reasonable comments. My main worry with long identifier names is that they shouldn't make the lines so long that they become incomprehensible. Jacob -- "There are only two types of data: Data which has been backed up Data which has not been lost - yet"