style wars

Bob Larson blarson at skat.usc.edu
Sun Dec 18 19:07:54 AEST 1988


Since this flamefest has come up again, I thought I would contribute
something I consider more readable than the "standard" representation.
Null statements are sometimes useful in C, mainly as loop bodies.

Some people use semicolon on a line by itself for the null statment.
I prefer a pair of braces:

		for(p = FIRST; p->next != NULL; p = p->next)
		    ;

looks strange to me, and takes two vertical lines.

		for(p = FIRST; p->next != NULL; p = p->next) {}

uses a special two character sequence to denote the null statement,
and takes only a single line.

(Vertical space is limited on the terminals I use to read and edit
programs, when comparing programs or looking at an insert file, only
11 lines of the function are visable.)
-- 
Bob Larson	Arpa: Blarson at Ecla.Usc.Edu	blarson at skat.usc.edu
Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson
Prime mailing list:	info-prime-request%ais1 at ecla.usc.edu
			oberon!ais1!info-prime-request



More information about the Comp.lang.c mailing list