The problem's not with tabs.  A tab is a perfectly straightforward thing.
 The problem, like with null pointers, untyped languages, fast cars,
Eclipse, etc., is with the operators.

But yes, if you commit something that mixes tabs and spaces because you did
a copy and paste job from some code you found on the Internet (an
unrealistic example, of course), and my tab width is different to yours, I'm
going to see some garbage.  This isn't a theoretical problem - I frequently
see diffs containing tabs because Eclipse defaults to tabs, and my console
shows tabs at a different size to Eclipse by default.

Regarding version control, I don't think it's a great problem to reformat
code, as long as that's all you change in the commit.  I do recall doing a
large reformat once to move a project away from mixing code styles, and I
accidentally committed some other change with it.  Finding that later when
it caused a regression was tricky.

On Wed, May 18, 2011 at 1:54 PM, Alexey Zinger <[email protected]>wrote:

> So you're saying the problem with tabs is that you might get a document
> that only looks right, but in reality it's using tabs, so that's the problem
> with tabs?  Did I miss something?
>
> If you're gonna reformat a document using a syntax-aware editor,
> reformatting tabs to spaces is actually easier than spaces to a different
> number of spaces.  In both cases you're messing up deltas in version
> control.
>
> Alexey
>
>
> ------------------------------
> *From:* Ricky Clarkson <[email protected]>
> *To:* [email protected]
> *Sent:* Wed, May 18, 2011 12:31:24 PM
>
> *Subject:* Re: [The Java Posse] Vs: Re: How many characters do you use for
> indention?
>
> It's easier to screw up formatting when incorporating code that uses tabs,
> because you might not realise it uses tabs.  Only the person who uses a
> different tab size to your editor might realise.
>
>
> --
> Skype: ricky_clarkson
> UK phone (forwards to Skype): 0161 408 5260
>
>
>
> On Wed, May 18, 2011 at 1:26 PM, Alexey Zinger <[email protected]>wrote:
>
>> Then there's no problem with tabs either.
>>
>> Alexey
>>
>>
>> ------------------------------
>> *From:* Ricky Clarkson <[email protected]>
>> *To:* [email protected]
>> *Sent:* Wed, May 18, 2011 12:13:09 PM
>>
>> *Subject:* Re: [The Java Posse] Vs: Re: How many characters do you use
>> for indention?
>>
>> It'll get reformatted.
>>
>> --
>> Skype: ricky_clarkson
>> UK phone (forwards to Skype): 0161 408 5260
>>
>>
>>
>> On Wed, May 18, 2011 at 11:01 AM, Alexey Zinger <[email protected]>wrote:
>>
>>> So what happens if you accept someone else's code, who was using the
>>> "wrong" number of spaces for indent and mix it with your code?
>>>
>>> Alexey
>>>
>>>
>>> ------------------------------
>>> *From:* Ricky Clarkson <[email protected]>
>>> *To:* [email protected]
>>> *Sent:* Wed, May 18, 2011 6:44:06 AM
>>> *Subject:* Re: [The Java Posse] Vs: Re: How many characters do you use
>>> for indention?
>>>
>>> The problem is that if you, accidentally or otherwise, end up with a
>>> mixture of tabs and spaces for indentation, people with different tab sizes
>>> set see your code as spaghetti.
>>>
>>> It's easier to write a rule that detects and rejects tabs than it is to
>>> detect a bad mixture of tabs and spaces.  In the latter, what would happen
>>> with:
>>>
>>> < tab >int[] x = {1, 2, 3, 4, 5,
>>> < tab >           6, 7, 8, 9, 10};
>>>
>>> --
>>> Skype: ricky_clarkson
>>> UK phone (forwards to Skype): 0161 408 5260
>>>
>>>
>>>
>>> On Wed, May 18, 2011 at 6:45 AM, Roland Tepp <[email protected]> wrote:
>>> > At the risk of causing some whitespace holy war, I would actually
>>> secont
>>> > that sentiment.
>>> >
>>> > I am actually rather surprised at the level of dislike for a tab
>>> character
>>> > among this crowd, because this tab character fits really well into the
>>> > semantics of nesting/indentation. You can express a level of
>>> indentation
>>> > with a single character and adjust the actual visual representation of
>>> the
>>> > indentation depth at the editor/IDE level.
>>> >
>>> > Also - if everyone used tab for indentation, it would open up elastic
>>> > tabstops and opening up.
>>> > Also, to throw it out here, I just stumbled upon a pretty neat idea
>>> talking
>>> > about sidestepping the whole tabs vs spaces discussion by using a word
>>> > processor for writing code instead. Quite bold proposal, I would say...
>>> >
>>> > kolmapäev, 18. mai 2011 9:56.33 UTC+3 kirjutas Casper Bang:
>>> >>
>>> >> > (anyone who mentions they use tabs, please line up against the back
>>> >> > wall)
>>> >>
>>> >> Bah if everyone just used a tab to signify a logical indentation
>>> >> level, your whole question becomes pointless - think about it for a
>>> >> second. Indentation should be about expressing semantics on screen,
>>> >> not act as a space macro in the AST. I usually render one indentation
>>> >> as 4 spaces.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "The Java Posse" group.
>>> > To post to this group, send email to [email protected].
>>> > To unsubscribe from this group, send email to
>>> > [email protected].
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/javaposse?hl=en.
>>> >
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "The Java Posse" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/javaposse?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "The Java Posse" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/javaposse?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "The Java Posse" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/javaposse?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "The Java Posse" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/javaposse?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to