Re: Tabs vs. Spaces

From: r norman (
Date: 05/24/04

Date: Mon, 24 May 2004 15:50:32 -0400

On Mon, 24 May 2004 21:06:28 +0200, The Mike <>

>Sorry for bothering you with such an old subject. However, I've
>recently read a corresponding disussion and I'm wondering once again:
>What's the fuzz about it? AFAICS it's quite simple: if I use spaces,
>everyone who reads my code has to suffer from my indentation style. If
>I use tabs everyone will be able to view the same code with any
>indentation depth she likes.
>It's often said that changing the tabsize could have unwanted
>sideeffects. How could that be? If I enter a <Tab>, a literal Tab
>will be inserted. It's up to the program (lpr, editor ...) to
>interpret the TAB. How could I possibly influence these programs?
>Don't get it. Thanks for your input.

If you want columns to align properly and you create your text with a
font that has fixed character width and you fill empty areas with
space characters, then anyone who displays the text with fixed
character width will see the proper formatting. Back in the olden
days, all displays were fixed character width.

On the other hand, if you use tabs then the only way to get columns
to align properly is if my display has the same tab spacing as yours.
Some people who liked to use many levels of indenting set their tabs
every 4 characters -- some oddballs even used three or five.
Unfortunately many output devices, especially mechanical ones like
teletypes and the new-fangled DECwriters usually had tab spacing fixed
at 8. So for text alignment, spaces were really the proper way to
create things.

On the other hand, back in those same olden days, system memory and
floppy disk storage was measured tens of kilobytes -- don't even get
me started with punched paper tape! Storing hundred or even thousands
of space characters in text files wasted precious resources -- tab
spacing set at 8 characters saved a lot of space. So it was a
constant battle. That is why tabify and detabify programs were common.

Next subjects: \n vs. \r\n vs \n\r and the use of Ctrl-Z as EOF mark!