You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Laurent Goujon (JIRA)" <ji...@apache.org> on 2017/01/10 00:47:58 UTC

[jira] [Commented] (DRILL-5184) Remove check style restriction on brackets for one-line statements

    [ https://issues.apache.org/jira/browse/DRILL-5184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15813389#comment-15813389 ] 

Laurent Goujon commented on DRILL-5184:
---------------------------------------

Google knows best: https://google.github.io/styleguide/javaguide.html#s4.1.1-braces-always-used

(and you can always turn on/off checkstyle in your IDE, or use -Dcheckstyle.skip when doing development builds)

> Remove check style restriction on brackets for one-line statements
> ------------------------------------------------------------------
>
>                 Key: DRILL-5184
>                 URL: https://issues.apache.org/jira/browse/DRILL-5184
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.8.0
>            Reporter: Paul Rogers
>            Priority: Minor
>
> Drill's build currently enforces a check style rule that all control statements must have brackets. For example:
> {code}
> if (true)
>   doSomething();
> {code}
> is perfectly valid Java: the construct with well-known semantics inherited from C.
> However, check style rejects the above. It must be:
> {code}
> if (true) {
>   doSomething();
>   }
> {code}
> Is this a good rule? Possibly. It may prevent the occasional bug. The real question is: is the benefit worth the cost? What is the cost? The cost is that developers tend to write legal Java code, do a build, wait for the build to fail, then must go back and fix code. The cost is thus x% of builds must be redone for trivial errors in check-style rules. In my own case, about half of builds fail because I'm in the habit of writing valid Java, not Drill-specific java...
> So, the question is, is the savings derived from avoiding some hypothetical bug worth the very real cost of reducing developer productivity?
> At the very least, make check-style issues into warnings to be ignored in development builds, cleaned up when preparing code for a PR.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)