C bites / programming style
VLD/VMB
gwyn at BRL.ARPA
Fri Sep 6 18:23:49 AEST 1985
The curly braces { } have NOTHING to do with the if().
Code formatting rules that pretend otherwise are misleading.
People who indent like
if ( cond )
{
stmt1
stmt2
}
most likely do so because the compound statement
{
stmt1
stmt2
}
is under control of the if(). The only slight possible quibble is
that really the insides of a compound statement could be indented
to show the scope of the compound statement:
{
stmt1
stmt2
}
With 8-column tab spacing, though, this turns out to be unworkable,
so virtually everyone using this style doesn't indent the insides
of a compound statement.
More information about the Comp.lang.c
mailing list