PROPOSAL: open and close brace optional for single statement try, catch, finally, method declaration
Tom Ball
tball at google.com
Fri May 15 07:31:14 PDT 2009
At Google braces are compulsory for the reasons you state, although we use
code-reviews rather than language changes to enforce it. I strongly
encourage engineering teams to investigate the use of existing tools to help
them "ratchet up" their source code quality.
CheckStyle<http://checkstyle.sourceforge.net/config_blocks.html#NeedBraces>,
for example, can also be used as a preprocessor or VCS check-in verifier
step to verify that braces are always used.
Tom
On Fri, May 15, 2009 at 12:34 AM, Howard Lovatt <howard.lovatt at iee.org>wrote:
> I would go the other way and make braces compulsory in all cases
> including single line blocks for if, while, etc. I say this because I
> have found missing braces to be a source of errors, particularly for
> newbies.
>
> -- Howard.
>
>
More information about the coin-dev
mailing list