Page 1 of 1

tabs versus spaces

Posted: Fri May 23, 2008 11:31 am
by koen.h
Is there a reason why you use one and wouldn't like the other?

Re: tabs versus spaces

Posted: Fri May 23, 2008 12:19 pm
by RobertGonzalez
Are you trying to start another T vs S flamewar? :roll:

This is one of those "vi" vs "emacs" discussions. Search around. I think we have talked about this before around here.

Re: tabs versus spaces

Posted: Fri May 23, 2008 12:55 pm
by koen.h
I am not starting another war. I just happened to read that tabs in some programs give problems. I was looking for other problems or aruments for/against. I'm not aware this discussion causes flamewars but I'm aware answers like yours don't encourage polite responses.

Re: tabs versus spaces

Posted: Fri May 23, 2008 1:05 pm
by RobertGonzalez
I apologize if my answer did not come across politely. I have seen enough "OOP" vs "procedural", "vi" vs "emacs" and "tabs" vs "spaces" fights break out around here that I attempt to prevent them at the first sight of one.

My response was not an attempt at being mean, rude or confrontational. To the contrary, I am trying to prevent those types of responses from even being posted.

As to the core of your question, what have you heard? I have not heard of spaces causing problems before, except in the case of version control systems that show edits made when tabs are converted to spaces and vice versa.

Re: tabs versus spaces

Posted: Fri May 23, 2008 1:15 pm
by koen.h
Ok, I just don't like being called a troll when I have no intention to.

The problem was that some program messed up tabs. I can't remember what exactly it was but it may have to with layout. I consider switching to spaces for another reason too, being it seems easier to align things like long arrays or method chains. A disadvantage could be that it increases file size (maybe not much but everything counts).

Re: tabs versus spaces

Posted: Fri May 23, 2008 1:24 pm
by RobertGonzalez
koen.h wrote:Ok, I just don't like being called a troll when I have no intention to.
Fair enough.
koen.h wrote:The problem was that some program messed up tabs. I can't remember what exactly it was but it may have to with layout. I consider switching to spaces for another reason too, being it seems easier to align things like long arrays or method chains. A disadvantage could be that it increases file size (maybe not much but everything counts).
Many programs can be configured to handle tabs as spaces and vice versa. There are some folks that love an 8 space equivalent tab, others, like me, prefer a tab that is equal to 4 spaces. Others that I know use a 3 space tab.

I know there was a huge discussion about this topic about a year ago. The discussion was remarkably amicable and both sides of the argument for/against provided some very good reasons why you should/shouldn't use tabs/spaces.

I have never heard of a tab character screwing anything up. At least not in PHP, HTML, CSS, etc. I know there are some pretty strictly typed languages where white space has meaning. I am sure in a language like that a tab could knacker some stuff up pretty good.