a style question

Jay A. Konigsberg jak at sactoh0.SAC.CA.US
Tue Oct 2 11:37:25 AEST 1990


In article <1990Sep30.220839.20183 at nntp-server.caltech.edu> manning at nntp-server.caltech.edu (Evan Marshall Manning) writes:
>
>Well, if the issue really is style...
>
>Don't ever use single-character variable names.  I use 'ix' for
>loop index variables for which I can come up with no better name,

Using single letter variable names was somethiing I used to do for
simple loops and character at a time reading.

e.g:    c = getchar()
	for(i=1; i<10; ++i)
	(i, j, k & l for small loops)

While I have been "cured" of this, I'm still not convinced. As long as
the use of single chararacter variables are used in limited ways, there
really isn't any loss.

Still, I now code like this:

e.g:    inpchar = getchar()
	for (loopinx=1; loopinx < 10; ++loopinx)

It keeps me from getting flamed for unreadable code ?!?

-- 
-------------------------------------------------------------
Jay @ SAC-UNIX, Sacramento, Ca.   UUCP=...pacbell!sactoh0!jak
If something is worth doing, it's worth doing correctly.



More information about the Comp.lang.c mailing list