You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/04/16 17:48:41 UTC

[GitHub] [accumulo] ctubbsii opened a new issue #1094: Formatter change: require braces around (one-liner) blocks

ctubbsii opened a new issue #1094: Formatter change: require braces around (one-liner) blocks
URL: https://github.com/apache/accumulo/issues/1094
 
 
   This is a proposed formatter change.
   
   I propose we require braces around one-liner blocks. This is generally safer (eliminates a category of bugs where intended code doesn't execute properly, because it's not contained in the block). However, it can make some small, dense blocks of code slightly less readable because it forces them to be spread out a bit. I think this is a reasonable trade-off, though, [a preferred style by some](https://google.github.io/styleguide/javaguide.html#s4.1.1-braces-always-used) and [a recommended best practice by many](https://softwareengineering.stackexchange.com/questions/16528/single-statement-if-block-braces-or-no).
   
   It should be easy to update our formatter to automatically insert these braces, so it should have minimal impact on developers.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services