Subject: The brace thing
To: None <tech-toolchain@netbsd.org>
From: Charles M. Hannum <mycroft@mit.edu>
List: tech-toolchain
Date: 08/18/1998 15:33:54
Since we're flaming about it, I'll toss in my $2.00:
Fully-braced if's are often a waste of screen real estate, and a waste
of brain cycles to parse. They add no value -- except in cases where
somebody did something stupid, which KNF should be attempting to cater
to.
Adding braces in the case that egcs complains about seems reasonable,
however. I suggest that the `least change' would be to simply define
`if' statements to never be a `single statement'; i.e. any nested `if'
warrants braces. Examples:
if (foo) {
if (bar())
feh;
}
or:
if (foo) {
if (bar())
feh;
else
gah;
}
(I think this is the style that many people use already, actually.)