[ https://issues.apache.org/jira/browse/MNGSITE-385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16996702#comment-16996702 ]
Elliotte Rusty Harold commented on MNGSITE-385: ----------------------------------------------- Perhaps Maven might adopt some other project's code style rules one day or include basic references to Effective Java or the Oracle Java guidelines, but I don't see us spending the effort to specify everything ourselves at this level of detail. > Code style should mention "else" style > -------------------------------------- > > Key: MNGSITE-385 > URL: https://issues.apache.org/jira/browse/MNGSITE-385 > Project: Maven Project Web Site > Issue Type: Task > Reporter: Benjamin Marwell > Priority: Major > > Hello, > the "code style page" at > [https://maven.apache.org/developers/conventions/code.html] should mention > the code style associated with the {{else}} keyword. > Example: I created my first PR using guard statements and kept the main code > on the lowest possible indentation level. Only the reviwers told me that this > is uncommon in apache projects and not wanted. While I do not go with "it's > clearer to read", it is more common to read if you are used to it not to see > any code without indentation. > Here's my PR with the discussion: > [https://github.com/apache/maven-checkstyle-plugin/pull/17.] You can clearly > see how I struggled and was suprised with the comments, as checkstyle did > went through anyway. > That said, if this is what is wanted, this should be mentioned on the code > conventions page as well. Maybe even add a checkstyle rule ("no if containing > break/return" and "no if without else"). While I myself prefer to use guard > statements, it seems uncommon for apache projects. > Please update the documentation rules accordingly. > -- This message was sent by Atlassian Jira (v8.3.4#803005)