Ulrich Spörlein wrote:
On Fri, 12.03.2010 at 11:36:25 +0100, Gary Jennejohn wrote:
On Thu, 11 Mar 2010 20:24:57 -0800
Garrett Cooper <yanef...@gmail.com> wrote:
I can haz PR review then? Here's an easy one :)...
http://www.freebsd.org/cgi/query-pr.cgi?pr=144644
Looks OK to me except I don't like the
if (something) {
one-line-of-code();
}
constructs, but according to style(9) these are sort-of OK, viz
Closing and opening braces go on the same line as the else. Braces that
are not necessary may be left out.
^^^^^^^^^^^^^^^
if (test)
stmt;
else if (bar) {
stmt;
stmt;
} else
stmt;
Saved by the "may."
True, but some folks (me included) really hate it, when different
bracing is used *within* the same statement. The example above really is
horrible. If one if/else-if clause needs braces, just brace them all. This
loses no vertical space (the dangling else excluded) and some folks find
it visually more pleasing/easier to read.
... hence begins the bikeshedding.
"Green"
My personal preference is that if one clause requires braces,
they all get them so you would never see
"else {"
or
"} else"
just
"else"
or
"} else {"
I just find it helps keep everything correctly associated when reading.
Bye,
Uli
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"