`if (a = b)' (was Standard indentation?)

Wade Guthrie evil at arcturus.UUCP
Sat Dec 17 07:23:55 AEST 1988


The sound of a programmer trying to read a C program flinging himself
against a wall.

In article <8536 at alice.UUCP>, ark at alice.UUCP (Andrew Koenig) writes:
> 	do	ch = getchar();
> 	while (ch != EOF)
> 		process(ch);
> or, with braces:
> 	do {
> 		ch = getchar();
> 	} while (ch != EOF) {
> 		process(ch);
> 	}

I really do not mean to flame this person, but the above constructions
are EXCEEDINGLY hard to read.  I much perfer the method which already
exists:

	while ( (c=getchar()) != EOF)
		process(c);

because it is easier for humans to parse (not to mention the fact that it
requires less space.


Wade Guthrie
Rockwell International
Anaheim, CA

(Rockwell doesn't necessarily believe / stand by what I'm saying; how could
they when *I* don't even know what I'm talking about???)



More information about the Comp.lang.c mailing list