C bites / programming style [if

styborsk styborsk at hpspkla.UUCP
Sat Sep 7 02:09:00 AEST 1985


This style makes a lot of sense if you look at it as follows.
The body of the if statement is ONE STATEMENT, either a single, simple 
statement such as "x = 1;" or a compound statement such as
	{
	x = 1;
	y = 2;
	}
or even a null statement such as ";".  In fact, the body of a while, for, etc.
falls into the same mold and everything becomes very consistent (which is very
nice if you are writing a package for an editor like Emacs to help you type 
your code).
When we first tried to standardize our coding style, this looked strange to me
too, but it kind of grows on you (like a fungus :-).
Randy Styborski
{ihnp4!hpfcla!}hpspkla!styborsk



More information about the Comp.lang.c mailing list