On 2004-09-03, Derrick Coetzee <
[email protected]> wrote:
[reasons not to use tabs, and how to cause various editors not to
use them automatically]
Thanks for the explanation. You probably don't want to look at my code, as
I adhere to the [tab|8_space] indent of K&R. I will, however, check out the
softtab routines. Thanks for that!
I, on the other hand, have no problem at all with "hard" (\t) tabs.
They should simply always *ALWAYS* display as "every 8th column"
(columns 1, 9, 17, etc., given the silly 1-origin instead of 0-origin
numbering on typical teletype / ADM-3 "glass-tty" / H19 / xterm /
whatever). If you want some other indentation -- such as "every
4th character" -- you tell your editor to do that, and it does
that, still leaving the "hard" tabs set at every 8th position.
(In vi, ":set shiftwidth=<number>", then use ^T and ^D to indent
and de-indent, and of course the << and >> commands as usual.)
Then, for posting to newsgroups, I just run the code through the
"expand" program on Unix-like systems. (I edited Pnews.sh to do
this for me, so that I need not remember to do it manually.)
In other words, if you do not like 8-character indentation, move
the indentation, not the action of the \t character. Then, before
dumping the bytes to a system that may use something other than
8-character tabs, expand the tabs to blanks.