You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/12/21 02:37:28 UTC

[GitHub] [hbase] Apache9 commented on pull request #3913: HBASE-26536 Checkstyle: permit single-line if-then statements

Apache9 commented on pull request #3913:
URL: https://github.com/apache/hbase/pull/3913#issuecomment-998421074


   Yes, spotless should be another issue.
   
   And on the 'one line if', for me, as said above, the old fashion is to not have '{}' at all, in our code base this is common. But now, it is not recommand to not have '{}' for a code block, especially for the 'if' 'else' statement, so for me I prefer we just use the standard form
   ```java
   if (foo) {
   } else {
   }
   ```
   No matter what is inside the code block. I do not think it introduces any difficulty on reading the code?
   
   And what concerns me more is changing a style will introduce more meaning less code changes in the future. If we are a new project, in fact I'm just fine with what ever style guidelines. I do not have very strong opinion on the code style, though I have some thoughts, but usually I will not call a veto. But we are a project which is more than 10 years old. We have already done lots of format work to format the 'if else' block to the suggested style, now if we change the style guide, we need a reformat again, which I do not think could gain much value.
   
   So I suggest we just open a discuss thread on the mailing list, to see what the community think about this. If there are more people think the one line if is good thing, then maybe it worth a try. If most people are just neutral, I would say let's just keep the old way.
   
   Thanks.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org