You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@helix.apache.org by "Kanak Biscuitwala (JIRA)" <ji...@apache.org> on 2013/08/13 20:20:48 UTC

[jira] [Commented] (HELIX-198) Unify helix code style

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

Kanak Biscuitwala commented on HELIX-198:
-----------------------------------------

It looks like there are a few different code style considerations:

1. Maximum line length. 80 and 100 are pretty common, and the code tends to follow 100.
2. Open brace on the same line or on a new line. Both exist currently. I prefer same line for code compactness (as well as else branches starting on the same line as a close brace)
3. Tabs vs spaces and how wide? The code mostly follows 2-space indentation, and 4 spaces on a line continuation
4. I prefer if (condition) over if(condition) and if ( condition ), and the code currently tends to follow that for the most part
5. int x = y + 7; is the spacing scheme we currently use and I prefer
6. Switch cases are not indented in the current code, and that is also my preference
7. No whitespace on empty lines

I think the sooner we can switch to using a template, the better. It's pretty easy to make and distribute one in Eclipse, and once it's set up, there's very little work to do. Comments, preferences?
                
> Unify helix code style
> ----------------------
>
>                 Key: HELIX-198
>                 URL: https://issues.apache.org/jira/browse/HELIX-198
>             Project: Apache Helix
>          Issue Type: Improvement
>            Reporter: dafu
>            Assignee: Kanak Biscuitwala
>
> helix source code is not uniformly formatted. this causes lots of format changes when modifying existing code. we'd better choose a code template to format all the existing code and stick to the code style.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira