Re: A stylistic question.
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Sat, 20 May 2006 21:57:50 GMT
"James Dow Allen" <jdallen2000@xxxxxxxxx> writes:
[...]
My "normal indent" is one TAB character, and I'm amazed people
mess around with spaces. It seems futile to try a TAB other than
8 spaces, though I admit 6 spaces would be slightly better.
4 spaces of indentation is almost too little for my taste.
I *do* like being able to line up begins and ends easily, so if I was
ever forced to work on code that used (gasp!) 2-space indentation
I'd become an indent(1) fan *real* quick. (2-space indentation may
look
OK on little fragments, but am I the only one that ever puts more than
3 or 4 lines of code into the body of a for or if?)
It's important to distinguish between tabstops and indentation levels.
Too many people seem to think they have to be the same thing.
Tabstops, in my opinion, should be set at 8 columns, always. That's
the default setting on every system I've used. Setting it to
something other than 8 means that anything containing tabs will look
different in *some* context (printing, viewing with a different
editor, etc.).
My own preferred indentation level has changed over the years;
currently, I like 4 spaces. My preferred text editor, vi, has
separate settings for "tabstop" and "shiftwidth". I type ^T at the
beginning of a line to indent by one shiftwidth, and ^D to un-indent
by one shiftwidth. vi automatically converts indentation to a
sequence of tabs and spaces (for example, a 12-column indent becomes a
tab followed by four spaces); it's a feature I wish I could turn off,
but I live with it. (I think some versions of vi can turn this off;
nvi can't.) I've defined an editor macro that filters the buffer
through "expand", which expands all tabs to the right number of
spaces.
I have no doubt that emacs can do something similar.
For the most part, I don't "mess around with spaces"; I let my editor
take care of it for me. Computers are generally pretty good at that
kind of thing.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- A stylistic question.
- From: Mark Healey
- Re: A stylistic question.
- From: Richard Heathfield
- Re: A stylistic question.
- From: James Dow Allen
- Re: A stylistic question.
- From: CBFalconer
- Re: A stylistic question.
- From: James Dow Allen
- Re: A stylistic question.
- From: Andrew Poelstra
- Re: A stylistic question.
- From: Bill Pursell
- Re: A stylistic question.
- From: Robert Latest
- Re: A stylistic question.
- From: James Dow Allen
- A stylistic question.
- Prev by Date: Re: speed of execution
- Next by Date: Re: Curses for win32 with VT100/ANSI support
- Previous by thread: Re: A stylistic question.
- Next by thread: Re: A stylistic question.
- Index(es):
Relevant Pages
|