You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2006/06/20 21:42:55 UTC

Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java)

On 6/20/06, eliast@apache.org <el...@apache.org> wrote:

> @@ -65,6 +65,9 @@
>                 buffer.append(servletRequest.getLocalPort());
>         }
>         buffer.append(servletRequest.getServletPath());
> +
> +  // So that .resolve() works appropriately.
> +  buffer.append("/");
>         try {
>                 return new URI(buffer.toString());
>         } catch (URISyntaxException e) {

This commit is a perfect example of something I've been wanting to bring up...

The abdera codebase currently mixes tabs and spaces in its indenting.
This wouldn't be so bad, except that it assumes that tab == two
spaces, which means that when you look at the code in many tools it'll
look all screwy because the default definition for tab stops are 8
spaces...

The end result is that you get diffs like this, where the indenting is
all screwed up.  It also means that when I open the files in any of
the various editors I use it looks weird, which annoys me ;-)

I'd personally prefer if we could move towards a style that simply
always uses spaces, thus avoiding this problem entirely.  If we do
want to do that, I'd suggest we do so soon, and in a sweeping commit
that ONLY changes that, so that we can get it over with and avoid
screwing up our revision history with that sort of sweeping change
later on in the project's life cycle.

Thoughts?

-garrett

Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java)

Posted by Elias Torres <el...@torrez.us>.

Garrett Rooney wrote:
> On 6/20/06, eliast@apache.org <el...@apache.org> wrote:
> 
>> @@ -65,6 +65,9 @@
>>                 buffer.append(servletRequest.getLocalPort());
>>         }
>>         buffer.append(servletRequest.getServletPath());
>> +
>> +  // So that .resolve() works appropriately.
>> +  buffer.append("/");
>>         try {
>>                 return new URI(buffer.toString());
>>         } catch (URISyntaxException e) {
> 
> This commit is a perfect example of something I've been wanting to bring
> up...
> 
> The abdera codebase currently mixes tabs and spaces in its indenting.
> This wouldn't be so bad, except that it assumes that tab == two
> spaces, which means that when you look at the code in many tools it'll
> look all screwy because the default definition for tab stops are 8
> spaces...
> 
> The end result is that you get diffs like this, where the indenting is
> all screwed up.  It also means that when I open the files in any of
> the various editors I use it looks weird, which annoys me ;-)
> 
> I'd personally prefer if we could move towards a style that simply
> always uses spaces, thus avoiding this problem entirely.  If we do
> want to do that, I'd suggest we do so soon, and in a sweeping commit
> that ONLY changes that, so that we can get it over with and avoid
> screwing up our revision history with that sort of sweeping change
> later on in the project's life cycle.
> 
> Thoughts?
> 
> -garrett

I just made the change because I noticed that James was using spaces.
I've changed my Eclipse to turn tabs into spaces and they are 2 chars long.

Is that ok with everyone?

-Elias

Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java)

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/20/06, Stephen Duncan <st...@gmail.com> wrote:
> Just to throw my two cents in, I think that using spaces for
> indentation is evil, and tabs should be used.
>
> But I also recognize that my opinion is the less standard one.  If
> spaces must be used, I do think it's best to standardize on 4 spaces
> for an indentaion.  This is, in my experience, by far the most common
> way to standardize.  If we go with 4 spaces, we'll be much more likely
> to get patches that actually comply...

FWIW, I have no overly strong opinion on how many spaces (I prefer 2,
but could live with 4), I simply loathe tabs and want to see them
eradicated from the source tree ;-)

-garrett

Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java)

Posted by Stephen Duncan <st...@gmail.com>.
Just to throw my two cents in, I think that using spaces for
indentation is evil, and tabs should be used.

But I also recognize that my opinion is the less standard one.  If
spaces must be used, I do think it's best to standardize on 4 spaces
for an indentaion.  This is, in my experience, by far the most common
way to standardize.  If we go with 4 spaces, we'll be much more likely
to get patches that actually comply...

-Stephen

On 6/20/06, Ugo Cei <ug...@gmail.com> wrote:
>
> On Jun 20, 2006, at 10:25 PM, James M Snell wrote:
>
> > To this point, the style I've been using as been the two-spaces indent
> > for everything.  Tabs are evil.  Let's stick to the spaces please.
>
> FWIW, the Apache world seems to generally prefer 4 spaces (see
> <http://wiki.apache.org/geronimo/CodingStandards> and <http://
> jakarta.apache.org/turbine/common/code-standards.html>). But in any
> case, yeah, tabs are evil :)
>
>         Ugo
>
>
> --
> Ugo Cei
> Blog: http://agylen.com/
> Open Source Zone: http://oszone.org/
> Evil or Not?: http://evilornot.info/
> Company: http://www.sourcesense.com/
>
>
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: # spaces for tabs

Posted by James M Snell <ja...@gmail.com>.
2!

Garrett Rooney wrote:
> On 6/20/06, Elias Torres <el...@torrez.us> wrote:
>> Will it be 2 or 4?
>>
>> I like 2 because I'm cheap.
> 
> I prefer 2, for what it's worth.
> 
> -garrett
> 

Re: # spaces for tabs (was: Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java))

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/20/06, Elias Torres <el...@torrez.us> wrote:
> Will it be 2 or 4?
>
> I like 2 because I'm cheap.

I prefer 2, for what it's worth.

-garrett

# spaces for tabs (was: Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java))

Posted by Elias Torres <el...@torrez.us>.
Will it be 2 or 4?

I like 2 because I'm cheap.

-Elias

Ugo Cei wrote:
> 
> On Jun 20, 2006, at 10:25 PM, James M Snell wrote:
> 
>> To this point, the style I've been using as been the two-spaces indent
>> for everything.  Tabs are evil.  Let's stick to the spaces please.
> 
> FWIW, the Apache world seems to generally prefer 4 spaces (see
> <http://wiki.apache.org/geronimo/CodingStandards> and
> <http://jakarta.apache.org/turbine/common/code-standards.html>). But in
> any case, yeah, tabs are evil :)
> 
>     Ugo
> 
> 
> --Ugo Cei
> Blog: http://agylen.com/
> Open Source Zone: http://oszone.org/
> Evil or Not?: http://evilornot.info/
> Company: http://www.sourcesense.com/
> 
> 
> 

Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java)

Posted by Ugo Cei <ug...@gmail.com>.
On Jun 20, 2006, at 10:25 PM, James M Snell wrote:

> To this point, the style I've been using as been the two-spaces indent
> for everything.  Tabs are evil.  Let's stick to the spaces please.

FWIW, the Apache world seems to generally prefer 4 spaces (see  
<http://wiki.apache.org/geronimo/CodingStandards> and <http:// 
jakarta.apache.org/turbine/common/code-standards.html>). But in any  
case, yeah, tabs are evil :)

	Ugo


-- 
Ugo Cei
Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Evil or Not?: http://evilornot.info/
Company: http://www.sourcesense.com/



Re: Tabs versus Spaces (was Re: svn commit: r415780 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/ServletRequestContext.java)

Posted by James M Snell <ja...@gmail.com>.
To this point, the style I've been using as been the two-spaces indent
for everything.  Tabs are evil.  Let's stick to the spaces please.

- James

Garrett Rooney wrote:
> On 6/20/06, eliast@apache.org <el...@apache.org> wrote:
> 
>> @@ -65,6 +65,9 @@
>>                 buffer.append(servletRequest.getLocalPort());
>>         }
>>         buffer.append(servletRequest.getServletPath());
>> +
>> +  // So that .resolve() works appropriately.
>> +  buffer.append("/");
>>         try {
>>                 return new URI(buffer.toString());
>>         } catch (URISyntaxException e) {
> 
> This commit is a perfect example of something I've been wanting to bring
> up...
> 
> The abdera codebase currently mixes tabs and spaces in its indenting.
> This wouldn't be so bad, except that it assumes that tab == two
> spaces, which means that when you look at the code in many tools it'll
> look all screwy because the default definition for tab stops are 8
> spaces...
> 
> The end result is that you get diffs like this, where the indenting is
> all screwed up.  It also means that when I open the files in any of
> the various editors I use it looks weird, which annoys me ;-)
> 
> I'd personally prefer if we could move towards a style that simply
> always uses spaces, thus avoiding this problem entirely.  If we do
> want to do that, I'd suggest we do so soon, and in a sweeping commit
> that ONLY changes that, so that we can get it over with and avoid
> screwing up our revision history with that sort of sweeping change
> later on in the project's life cycle.
> 
> Thoughts?
> 
> -garrett
>