Peter Danenberg wrote:
Brace style is certainly a religious issue, Tim.
K&R, however, dictates a hybrid: new-line open braces,
namely, for functions; and contiguous ones for statements:
Yes, a hybrid which I stick to fairly closely, as I have done for some
years. Except in the face of peer pressure, perhaps. A more interesting
question is the handling of multi-line function invocations and if
statements. Lee's style seems to involve a two space indent, distinguished
from a tab:
if ( some long
line ) {
do something
}
and
func(lots and lots of
parameters);
Whereas I would tend to mix in a bit of Allman:
if (some long
line)
{
do something;
}
func(lots and lots
of parameters
);
I'm also influenced by Microsoft's
perhaps(
even,
excessive
use,
of, /* vertical space */
seen in the Windows API
);
Fear the right margin!
-- Tim Starling