.. although the Linux Kernel team does not use braces when there is only
one statement after the conditional. I would prefer we follow this
standard more closely, and eliminate braces around a single statement.
Anyone else have this preference?
Matthew Weier O'Phinney wrote:
-- P?draic Brady <[EMAIL PROTECTED]> wrote
(on Thursday, 28 September 2006, 01:24 AM -0700):
Parts of the standards seem to follow opposing preferences. While
functions and methods place the opening brace on its own line, control
statements state they should place on the same line as the statement
def.
Seems a bit odd. I usually do the opposite :), but esp. not placing
control statement braces on a new line reduces readability IMO. A
method def is easy to spot - following control statements is far more
complicated.
Odd as it may seem, it's a fairly well-known standard often referred to
as the 'One True Brace':
http://wikipedia.org/wiki/One_true_brace
The style is also used in PEAR and Linux kernel development.