C format

utzoo!decvax!duke!harpo!ihps3!ihnss!warren utzoo!decvax!duke!harpo!ihps3!ihnss!warren
Fri Oct 22 15:02:51 AEST 1982


I agree with those who want to code if statements as:

if ( ... )
{
	.
	.
	.
}

Furthermore, I would make it manditory to enclose the dependent
clause in braces whenever it goes over 1 line.  There is a lot of
code out there that looks like:
if (foo)
	bar

It's way too tempting, particularly without a screen editor, just to
add another statement to the dependent clause without realizing that
it isn't part of the if anymore.

(I think that if you want to avoid the braces, put it all one one line!)


Warren Montgomery
(ihnss!warren)



More information about the Comp.lang.c mailing list