You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Colm O hEigeartaigh <co...@apache.org> on 2016/02/10 12:23:12 UTC

Coding standards

Hi,

Is there a set coding standard for Apache Ranger? I am seeing a mix of
different styles in the code. For example, "DefaultFormatter" has both tab
and 4-space indentation in the same file. There are also a lot of
inconsistencies with spacing, for example:

if (trimmedLine.startsWith("--") ||trimmedLine.length()<1) {

if(connectString.toLowerCase().startsWith("jdbc:oracle") &&
inputFileName!=null){

I suggest starting by picking a indentation standard (tabs or preferably 4
space indentation) and using automated tooling to convert the existing
source. If there is a consensus on this I can pick it up.

Colm.


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: Coding standards

Posted by Madhan Neethiraj <ma...@apache.org>.
Colm,

I my experience, restricting to a specific indentation/space style do not go well with a lot of developers. Each developer comes through different set of conditionings and forcing changes can be counter productive. Most IDEs today are helpful in formatting to a readable code. If/when a really unreadable format is seen, appropriate review comments can be helpful to fix it.


My only recommendation is to resist from “reformatting” existing code just to comply with a specific developer’s conditioning. It just makes it harder to review the code. Reviewers will appreciate not having to spend time in going through the “space” changes; that time is well spent on looking at other important details.

Thanks,
Madhan


On 2/10/16, 3:23 AM, "Colm O hEigeartaigh" <co...@apache.org> wrote:

>Hi,
>
>Is there a set coding standard for Apache Ranger? I am seeing a mix of
>different styles in the code. For example, "DefaultFormatter" has both tab
>and 4-space indentation in the same file. There are also a lot of
>inconsistencies with spacing, for example:
>
>if (trimmedLine.startsWith("--") ||trimmedLine.length()<1) {
>
>if(connectString.toLowerCase().startsWith("jdbc:oracle") &&
>inputFileName!=null){
>
>I suggest starting by picking a indentation standard (tabs or preferably 4
>space indentation) and using automated tooling to convert the existing
>source. If there is a consensus on this I can pick it up.
>
>Colm.
>
>
>-- 
>Colm O hEigeartaigh
>
>Talend Community Coder
>http://coders.talend.com