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 <yanefbsd_at_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_at_freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"Received on Fri Mar 12 2010 - 18:10:55 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:01 UTC