You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by Drew Farris <dr...@apache.org> on 2011/10/13 03:46:58 UTC

Indentation style?

Hi All,

I'm wondering if there's consensus on the indentation style for Accumulo?

In the code and poms, I'm seeing cases where tabs are used, where
spaces are used, where each is used interchangeably, sometimes mixed
in the same file. This makes things difficult to read in some cases.

I'm used to the Lucene style, spaces instead of tabs, with two space
indents, as embodied in
http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml

Are there styles others prefer?

I also want to say upfront that I'm not suggesting a large scale code
reformatting to get everything to adhere to any one style at once. I'm
simply curious whether there is a style contributors should adhere to
going forward, with indentation being fixed as needed along with other
changes.

Drew

Re: Indentation style?

Posted by Keith Turner <ke...@deenlo.com>.
+1 for consistent formatting

On Thu, Oct 13, 2011 at 1:41 AM, Todd Lipcon <to...@cloudera.com> wrote:
> +1 for two-spaces no tabs! It's the style used by all of the Hadoop
> ecosystem projects that I've seen so far, so if you hope to share
> developers with them, there's some value in consistency.
>
> Large-scale reformatting is awful in an existing project with a long
> svn history since it breaks svn blame, etc. But since this was a new
> svn import, now is the best (only) time to consider doing one :)
>

+1 for reformatting all of the code.... I propose we do this Fri afternoon

Re: Indentation style?

Posted by Todd Lipcon <to...@cloudera.com>.
+1 for two-spaces no tabs! It's the style used by all of the Hadoop
ecosystem projects that I've seen so far, so if you hope to share
developers with them, there's some value in consistency.

Large-scale reformatting is awful in an existing project with a long
svn history since it breaks svn blame, etc. But since this was a new
svn import, now is the best (only) time to consider doing one :)

-Todd

On Wed, Oct 12, 2011 at 7:28 PM, Jesse Yates <je...@gmail.com> wrote:
> +1 with doing a large scale formatting.
>
> I think it is important that we just pick one style and make sure it is
> unique across the codebase, more than exactly what it is (though like every
> developer I have my preferences :)
>
> I generally also like to use the same kind of formatting Drew is
> recommending. I tend to use HBase's formatting, which is pretty close to
> what Drew already mentioned.
>
> Also, if there is a current standard (or if we create one), it needs to be
> added to a FAQ (or equivalent) section of the website.
>
> -Jesse Yates
>
> On Wed, Oct 12, 2011 at 6:46 PM, Drew Farris <dr...@apache.org> wrote:
>
>> Hi All,
>>
>> I'm wondering if there's consensus on the indentation style for Accumulo?
>>
>> In the code and poms, I'm seeing cases where tabs are used, where
>> spaces are used, where each is used interchangeably, sometimes mixed
>> in the same file. This makes things difficult to read in some cases.
>>
>> I'm used to the Lucene style, spaces instead of tabs, with two space
>> indents, as embodied in
>> http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml
>>
>> Are there styles others prefer?
>>
>> I also want to say upfront that I'm not suggesting a large scale code
>> reformatting to get everything to adhere to any one style at once. I'm
>> simply curious whether there is a style contributors should adhere to
>> going forward, with indentation being fixed as needed along with other
>> changes.
>>
>> Drew
>>
>



-- 
Todd Lipcon
Software Engineer, Cloudera

Re: Indentation style?

Posted by Jesse Yates <je...@gmail.com>.
+1 with doing a large scale formatting.

I think it is important that we just pick one style and make sure it is
unique across the codebase, more than exactly what it is (though like every
developer I have my preferences :)

I generally also like to use the same kind of formatting Drew is
recommending. I tend to use HBase's formatting, which is pretty close to
what Drew already mentioned.

Also, if there is a current standard (or if we create one), it needs to be
added to a FAQ (or equivalent) section of the website.

-Jesse Yates

On Wed, Oct 12, 2011 at 6:46 PM, Drew Farris <dr...@apache.org> wrote:

> Hi All,
>
> I'm wondering if there's consensus on the indentation style for Accumulo?
>
> In the code and poms, I'm seeing cases where tabs are used, where
> spaces are used, where each is used interchangeably, sometimes mixed
> in the same file. This makes things difficult to read in some cases.
>
> I'm used to the Lucene style, spaces instead of tabs, with two space
> indents, as embodied in
> http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml
>
> Are there styles others prefer?
>
> I also want to say upfront that I'm not suggesting a large scale code
> reformatting to get everything to adhere to any one style at once. I'm
> simply curious whether there is a style contributors should adhere to
> going forward, with indentation being fixed as needed along with other
> changes.
>
> Drew
>

Re: Indentation style?

Posted by Joey Echeverria <jo...@cloudera.com>.
-1 tabs.

I've never seen people stick exclusively to tabs. If you don't, then
you can't change your tab settings from whatever other people or
using, or some parts of the code doesn't look right. I'm in favor of
adopting the Hadoop standards as they're fairly widespread and cover
most of the code I look at and write :)

-Joey

On Fri, Oct 14, 2011 at 2:29 PM, John W Vines <jo...@ugov.gov> wrote:
> +1 tabs - as long as we are consistent, which we will be, then there will be no issues with needing specific settings for it to look correct. Let the user control how their page looks by letting them set tab size instead of forcing them to use a specific space count.
>
> ----- Original Message -----
> From: "Esteban Gutierrez" <es...@cloudera.com>
> To: accumulo-dev@incubator.apache.org
> Sent: Thursday, October 13, 2011 4:39:33 PM
> Subject: Re: Indentation style?
>
> +1 for two-spaces
> -1 for tabs
>
> esteban
>
>
> On Thu, Oct 13, 2011 at 1:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:
>
>> +1 for consistent formatting.
>> +1 for tabs.
>> -1 for spaces.
>>
>> Tabs are nice because everyone can choose their own look and feel (i.e. I
>> don't have to look at 2-space indenting!).
>>
>> Adam
>>
>>
>> On Wed, Oct 12, 2011 at 9:46 PM, Drew Farris <dr...@apache.org> wrote:
>>
>> > Hi All,
>> >
>> > I'm wondering if there's consensus on the indentation style for Accumulo?
>> >
>> > In the code and poms, I'm seeing cases where tabs are used, where
>> > spaces are used, where each is used interchangeably, sometimes mixed
>> > in the same file. This makes things difficult to read in some cases.
>> >
>> > I'm used to the Lucene style, spaces instead of tabs, with two space
>> > indents, as embodied in
>> > http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml
>> >
>> > Are there styles others prefer?
>> >
>> > I also want to say upfront that I'm not suggesting a large scale code
>> > reformatting to get everything to adhere to any one style at once. I'm
>> > simply curious whether there is a style contributors should adhere to
>> > going forward, with indentation being fixed as needed along with other
>> > changes.
>> >
>> > Drew
>> >
>>
>



-- 
Joseph Echeverria
Cloudera, Inc.
443.305.9434

Re: Indentation style?

Posted by John W Vines <jo...@ugov.gov>.
+1 tabs - as long as we are consistent, which we will be, then there will be no issues with needing specific settings for it to look correct. Let the user control how their page looks by letting them set tab size instead of forcing them to use a specific space count.

----- Original Message -----
From: "Esteban Gutierrez" <es...@cloudera.com>
To: accumulo-dev@incubator.apache.org
Sent: Thursday, October 13, 2011 4:39:33 PM
Subject: Re: Indentation style?

+1 for two-spaces
-1 for tabs

esteban


On Thu, Oct 13, 2011 at 1:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:

> +1 for consistent formatting.
> +1 for tabs.
> -1 for spaces.
>
> Tabs are nice because everyone can choose their own look and feel (i.e. I
> don't have to look at 2-space indenting!).
>
> Adam
>
>
> On Wed, Oct 12, 2011 at 9:46 PM, Drew Farris <dr...@apache.org> wrote:
>
> > Hi All,
> >
> > I'm wondering if there's consensus on the indentation style for Accumulo?
> >
> > In the code and poms, I'm seeing cases where tabs are used, where
> > spaces are used, where each is used interchangeably, sometimes mixed
> > in the same file. This makes things difficult to read in some cases.
> >
> > I'm used to the Lucene style, spaces instead of tabs, with two space
> > indents, as embodied in
> > http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml
> >
> > Are there styles others prefer?
> >
> > I also want to say upfront that I'm not suggesting a large scale code
> > reformatting to get everything to adhere to any one style at once. I'm
> > simply curious whether there is a style contributors should adhere to
> > going forward, with indentation being fixed as needed along with other
> > changes.
> >
> > Drew
> >
>

Re: Indentation style?

Posted by Esteban Gutierrez <es...@cloudera.com>.
+1 for two-spaces
-1 for tabs

esteban


On Thu, Oct 13, 2011 at 1:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:

> +1 for consistent formatting.
> +1 for tabs.
> -1 for spaces.
>
> Tabs are nice because everyone can choose their own look and feel (i.e. I
> don't have to look at 2-space indenting!).
>
> Adam
>
>
> On Wed, Oct 12, 2011 at 9:46 PM, Drew Farris <dr...@apache.org> wrote:
>
> > Hi All,
> >
> > I'm wondering if there's consensus on the indentation style for Accumulo?
> >
> > In the code and poms, I'm seeing cases where tabs are used, where
> > spaces are used, where each is used interchangeably, sometimes mixed
> > in the same file. This makes things difficult to read in some cases.
> >
> > I'm used to the Lucene style, spaces instead of tabs, with two space
> > indents, as embodied in
> > http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml
> >
> > Are there styles others prefer?
> >
> > I also want to say upfront that I'm not suggesting a large scale code
> > reformatting to get everything to adhere to any one style at once. I'm
> > simply curious whether there is a style contributors should adhere to
> > going forward, with indentation being fixed as needed along with other
> > changes.
> >
> > Drew
> >
>

Re: Indentation style?

Posted by Jesse Yates <je...@gmail.com>.
Can we move this discussion to the ticket as previously mentioned? Just so
we have documentation close to the problem.

-Jesse

ps. I'm for 2 spaces - its just standard for java as a whole.

On Mon, Oct 17, 2011 at 2:09 PM, Billie J Rinaldi <billie.j.rinaldi@ugov.gov
> wrote:

> It sounds as if we are agreed on spaces, and now must decide how many
> spaces.
>
> 2 spaces
> - pros: consistency with related projects
> - cons: some people dislike this spacing / find the code less readable
>
> 4 spaces
> - pros: haven't heard anyone here speak vehemently against 4 spaces yet
> - cons: lack of consistency with related projects
>
> Shall we vote between them?  We have a deadline of Wednesday, let's say 36
> hours from now, on ACCUMULO-41.
>
> Billie
>

Re: Indentation style?

Posted by Billie J Rinaldi <bi...@ugov.gov>.
It sounds as if we are agreed on spaces, and now must decide how many spaces.

2 spaces
- pros: consistency with related projects
- cons: some people dislike this spacing / find the code less readable

4 spaces
- pros: haven't heard anyone here speak vehemently against 4 spaces yet
- cons: lack of consistency with related projects

Shall we vote between them?  We have a deadline of Wednesday, let's say 36 hours from now, on ACCUMULO-41.

Billie

Re: Indentation style?

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
<mentorHatOff>
My 2 cents that can be totally ignored.  :)

Tab based formatting falls apart when you have statements that continue on the next line.  It is those kinds of statements where it's very important to keep the formatting to efficiently convey the logic and intention of what the statement is meant to do.  With that said, I've always been against tabs.

Another personal preference, I hate 2-space tabs.  It makes it difficult for me to easily see the logic in nested statements.  The argument that the code veers too much to the right does not hold water to my mind with my reply being that it's an indication that the code logic is too convoluted and needs to be simplified.
</mentorHatOff>


Regards,
Alan

On Oct 17, 2011, at 10:08 AM, Adam Fuchs wrote:

> I concede that spaces are more consistent across tools, although I stand by
> my assertion that tabs can be more customizable to individual preferences.
> Thus, I withdraw my previous vote and replace it with:
> 
> +1 tabs
> +1 spaces
> +1 consistent formatting
> 
> Adam
> 
> 
> On Mon, Oct 17, 2011 at 10:56 AM, Keith Turner <ke...@deenlo.com> wrote:
> 
>> On Thu, Oct 13, 2011 at 4:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:
>>> +1 for consistent formatting.
>>> +1 for tabs.
>>> -1 for spaces.
>>> 
>>> Tabs are nice because everyone can choose their own look and feel (i.e. I
>>> don't have to look at 2-space indenting!).
>>> 
>> 
>> I would like to get to make a decision and reformat the existing code
>> ASAP.  I was undecided this morning, I did not think there was a clear
>> advantage to one or the other.  We were discussing the pros and cons.
>> It seems the main pro w/ spaces, is consistency.  The code looks the
>> same everywhere (in less, vim, eclipse, code coverage tool, notepad,
>> etc).  With tabs, each one of these tools would need to be configured
>> by the user to achieve consistency.  The pro w/ tabs is that each user
>> can make the code look how they like.  I like the idea of a consistent
>> look in all tools and being able to modify the tab stop is not
>> important to me, I will get used to whatever we decide to go with.
>> 
>> +1 for spaces (using hadoop formatting style)
>> -1 for tabs
>> 
>> Keith
>> 


Re: Indentation style?

Posted by Adam Fuchs <ad...@ugov.gov>.
I concede that spaces are more consistent across tools, although I stand by
my assertion that tabs can be more customizable to individual preferences.
Thus, I withdraw my previous vote and replace it with:

+1 tabs
+1 spaces
+1 consistent formatting

Adam


On Mon, Oct 17, 2011 at 10:56 AM, Keith Turner <ke...@deenlo.com> wrote:

> On Thu, Oct 13, 2011 at 4:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:
> > +1 for consistent formatting.
> > +1 for tabs.
> > -1 for spaces.
> >
> > Tabs are nice because everyone can choose their own look and feel (i.e. I
> > don't have to look at 2-space indenting!).
> >
>
> I would like to get to make a decision and reformat the existing code
> ASAP.  I was undecided this morning, I did not think there was a clear
> advantage to one or the other.  We were discussing the pros and cons.
> It seems the main pro w/ spaces, is consistency.  The code looks the
> same everywhere (in less, vim, eclipse, code coverage tool, notepad,
> etc).  With tabs, each one of these tools would need to be configured
> by the user to achieve consistency.  The pro w/ tabs is that each user
> can make the code look how they like.  I like the idea of a consistent
> look in all tools and being able to modify the tab stop is not
> important to me, I will get used to whatever we decide to go with.
>
> +1 for spaces (using hadoop formatting style)
> -1 for tabs
>
> Keith
>

Re: Indentation style?

Posted by John W Vines <jo...@ugov.gov>.
After this discussion, I withdraw my vote for tabs. I have created a ticket ( https://issues.apache.org/jira/browse/ACCUMULO-41 ) for the change in formatting, discussions on it can continue through Wednesday unless a sufficient point is brought up to extend conversation. For those who do not want to click a link, I am planning on the Lucene style indentation Drew shared in the original post in this discussion. We can also talk about the specific type of style if anyone has thoughts on it.


John


----- Original Message -----
From: "Keith Turner" <ke...@deenlo.com>
To: accumulo-dev@incubator.apache.org
Sent: Monday, October 17, 2011 10:56:55 AM
Subject: Re: Indentation style?

On Thu, Oct 13, 2011 at 4:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:
> +1 for consistent formatting.
> +1 for tabs.
> -1 for spaces.
>
> Tabs are nice because everyone can choose their own look and feel (i.e. I
> don't have to look at 2-space indenting!).
>

I would like to get to make a decision and reformat the existing code
ASAP.  I was undecided this morning, I did not think there was a clear
advantage to one or the other.  We were discussing the pros and cons.
It seems the main pro w/ spaces, is consistency.  The code looks the
same everywhere (in less, vim, eclipse, code coverage tool, notepad,
etc).  With tabs, each one of these tools would need to be configured
by the user to achieve consistency.  The pro w/ tabs is that each user
can make the code look how they like.  I like the idea of a consistent
look in all tools and being able to modify the tab stop is not
important to me, I will get used to whatever we decide to go with.

+1 for spaces (using hadoop formatting style)
-1 for tabs

Keith

Re: Indentation style?

Posted by Billie J Rinaldi <bi...@ugov.gov>.
On Monday, October 17, 2011 10:56:55 AM, "Keith Turner" <ke...@deenlo.com> wrote:
> I would like to get to make a decision and reformat the existing code
> ASAP.

+1 for spaces.  I'd prefer 4, but I could deal with 2.

Billie

Re: Indentation style?

Posted by Keith Turner <ke...@deenlo.com>.
On Thu, Oct 13, 2011 at 4:36 PM, Adam Fuchs <ad...@ugov.gov> wrote:
> +1 for consistent formatting.
> +1 for tabs.
> -1 for spaces.
>
> Tabs are nice because everyone can choose their own look and feel (i.e. I
> don't have to look at 2-space indenting!).
>

I would like to get to make a decision and reformat the existing code
ASAP.  I was undecided this morning, I did not think there was a clear
advantage to one or the other.  We were discussing the pros and cons.
It seems the main pro w/ spaces, is consistency.  The code looks the
same everywhere (in less, vim, eclipse, code coverage tool, notepad,
etc).  With tabs, each one of these tools would need to be configured
by the user to achieve consistency.  The pro w/ tabs is that each user
can make the code look how they like.  I like the idea of a consistent
look in all tools and being able to modify the tab stop is not
important to me, I will get used to whatever we decide to go with.

+1 for spaces (using hadoop formatting style)
-1 for tabs

Keith

Re: Indentation style?

Posted by Adam Fuchs <ad...@ugov.gov>.
+1 for consistent formatting.
+1 for tabs.
-1 for spaces.

Tabs are nice because everyone can choose their own look and feel (i.e. I
don't have to look at 2-space indenting!).

Adam


On Wed, Oct 12, 2011 at 9:46 PM, Drew Farris <dr...@apache.org> wrote:

> Hi All,
>
> I'm wondering if there's consensus on the indentation style for Accumulo?
>
> In the code and poms, I'm seeing cases where tabs are used, where
> spaces are used, where each is used interchangeably, sometimes mixed
> in the same file. This makes things difficult to read in some cases.
>
> I'm used to the Lucene style, spaces instead of tabs, with two space
> indents, as embodied in
> http://people.apache.org/~rmuir/Eclipse-Lucene-Codestyle.xml
>
> Are there styles others prefer?
>
> I also want to say upfront that I'm not suggesting a large scale code
> reformatting to get everything to adhere to any one style at once. I'm
> simply curious whether there is a style contributors should adhere to
> going forward, with indentation being fixed as needed along with other
> changes.
>
> Drew
>

Re: Indentation style?

Posted by Eric Newton <er...@gmail.com>.
+1 and i think it would be good to match the rest of the community

On Thu, Oct 13, 2011 at 10:57 AM, Billie J Rinaldi <
billie.j.rinaldi@ugov.gov> wrote:

> On Wednesday, October 12, 2011 9:46:58 PM, "Drew Farris" <dr...@apache.org>
> wrote:
> > I'm wondering if there's consensus on the indentation style for
> > Accumulo?
>
> +1 for applying consistent formatting; I don't care which style.
>

Re: Indentation style?

Posted by Billie J Rinaldi <bi...@ugov.gov>.
On Wednesday, October 12, 2011 9:46:58 PM, "Drew Farris" <dr...@apache.org> wrote:
> I'm wondering if there's consensus on the indentation style for
> Accumulo?

+1 for applying consistent formatting; I don't care which style.