Tabs or spaces?

From WhyNotWiki

Jump to: navigation, search

[edit] Advantages of tabs

The user can set the tab width (how many spaces to show for each space) however he wants. With spaces, you're generally stuck with whatever the author prefers.

[edit] Advantages of spaces

You can copy from a source that has converted to spaces already (such as a pre code box on web page? or a vim session in your terminal) and paste it and it might look good in the target document, as long as they used the same number of spaces as you....

You can easily type spaces in a normal HTML textbox on a Web site. Tabs, on the other hand, cause problems: the tab key usually moves the input to the next field in the form rather than inserting a tab character.

[edit]

http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-February/002685.html


On 18/02/2006, at 3:38 AM, Ryan Gahl wrote:
> Sammi, I didn't look at the code, but I would say, keep sending your
> stuff, good stuff. As far as any official patch, who knows. The people
> that need/want the functionality you are offering will take it and run
> with it. Those that don't want a modified core file will figure out  
> how
> to take your stuff and factor it into a separate file. Just keep
> contributing like this.
>
> As far as indenting... the fact that the author(s) used spaces for
> indentation in the first place has always been an annoyance. Why not
> just hit the TAB key once and make all tabs equal rather than hitting
> space multiple times and ending up with all sorts of inconsistent
> indentation?

[...] I think TAB is much better for indentation, that is  
what it was created for.. but then let's not get into a flame war  
about it.

On 18/02/2006, at 3:44 AM, Thomas Fuchs wrote:
> Tabs are evil, because they're formatted in different ways on  
> different editors.
> Your text editor should allow for switching to soft spaces when you  
> hit tab.
> The official scriptaculous/prototype/rails style is 2 spaces  
> instead of a tab.
>
> You do use an editor that allows for this, do you...? :)
>
> -Thomas

I use Textmate which has great support for TABs - I can choose what  
size I want them to be, and so on. Tabs shouldn't be formatted in  
different ways in different editors. A tab can have its width  
altered. For example, in Textmate, I can choose for my tab to be 2  
spaces, 3 spaces, and so on. I don't see why this is evil? Hitler was  
probably evil.. but TAB spacing?

On 18/02/2006, at 4:05 AM, Ryan Gahl wrote:
> Oh ok, that explains it. I guess I never thought tabs were  
> formatted so
> differently across IDEs/editors... shouldn't most editors allow  
> changing
> how tabs behave (just like as you mentioned for soft tabs)?
>

Exactly!! That is what TABs allow - to easily set your personal  
preference. Work on an 80 column terminal? Set your TAB spacing to 1.  
Work on a 23" Display? Set your tab spacing to 6. Whatever you need.

Robin Haswell. [Rails-spinoffs Sortable Tree Addition [PATCH]] (http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-February/002672.html). Retrieved on 2007-05-11 11:18.


Why does it matter how a tab is displayed in a different editor? A tab 
is a tab, it denotes "indent". Furthermore, tabs are semantically 
accurate, allowing different users to choose how much indentation they 
want. For people with keen eyesight they can set tabs to be displayed at 
one-space. People with wide monitors can use 4 spaces. Etc. Hit tab and 
you go right one. Hit backspace and you go left one - unlike using softtabs.

Soft tabs are tables.
Tabs are CSS.

Anyone who thinks spacing is better than tabs is unequivocally wrong. 
No-one will ever sway me from this opinion.


Personal tools