Paul Rogers created DRILL-5184:
----------------------------------
Summary: 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)