home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!infonode!ingr!b30news!mueller
- From: mueller@b30news.b30.ingr.com ( Phil Mueller )
- Subject: Re: average identifier length (was Comments: Code...)
- Message-ID: <1992Dec15.131302.22615@b30.ingr.com>
- Sender: mueller@b30.ingr.com (Phil Mueller)
- Organization: Intergraph
- References: <1512@gistdev.gist.com> <12ea/11dbc@jspc.wimsey.bc.ca> <craigh.723767103@cserver>
- Distribution: na
- Date: Tue, 15 Dec 1992 13:13:02 GMT
- Lines: 55
-
- In article <craigh.723767103@cserver> craigh@cserver.plexus.com (Craig Heilman) writes:
- >jonathan@jspc.wimsey.bc.ca (Jonathan Story) writes:
- >
- >>In article <1992Dec5.094805@eklektix.com>
- >> rcd@raven.eklektix.com (Dick Dunn) writes:
- >>> marick@cs.uiuc.edu (Brian Marick) writes:
- >>> >Whether you use short or long names, as important as comprehensibility
- >>> >of correct code is avoiding incorrect code...
- >>>
- >>> fair enough, but only cautious approval here...
- >>>
- >>> >My advice is to use whatever identifier style you like: but make sure
- >>> >names are more than one typo away from other names in the same
- >>> >routine. "i" and "j" are bad loop indices;...
- >>>
- >>> No, they're not. At the least, when you're writing code to implement
- >
- >>Yes, they are. Granted, loop indices probably don't need long
- >>identifiers, but there is a second consideration: searching. When you
- >>want to see where variable 'i' is used, you are going to get a number of
- >>false hits. Recommendation: use 'ii', 'jj', etc.
- >
- >If you are using vi to look at your code then you can find all uses of
- >any "word" by specifying your search as \<word\>. For example, to find
- >all uses of i you would say \<i\> (this search pattern can be specified
- >anywhere you would normally use a search pattern...). This search will
- >find all these i's:
- >
- > long i;
- > for (i = 0; i < MAX; ++i)
- > array[i] = ...
- >
- >but not these i's:
- >
- > int j;
- > /* this is a test */
- > myVariableName
- >
- >Try it and see :-)
- >
-
- So you're going to force everyone to use vi?
- AAAARRRRGGGGHHHH!!!!
-
- I'm glad someone else uses the 'ii' technique. Means that there's some
- code I may have to maintain someday that doesn't use 'i' <gag>.
-
- To Craig:
- If you got a mail message from me, sorry. I typed 'R' instead of 'F'
-
-
-
- --
- Phil Mueller mueller@b30news.b30.ingr.com
- The preceeding opinions are not necessarily those of Intergraph Corporation.
-