On Thu, May 13, 2004 at 02:58:16PM +0100, Paul Jakma wrote:
> With regard to space vs tabs: My preferred form of indentation on
> principle is to use tabs, however too many people and too many
> editors get it wrong or are inconsistent with each other. The source
> code itself is vivid testament to this, even to individual lines that
> use both tabs and space to indent (yuk). Space chars are the only
> form of indentation that have a reasonably good chance of being
> consistent.
Paul,
[.My comments should not take great weight, since I am not presently
contributing to Quagga development.]
I don't think that either of the characters has a greater chance of
being interpreted/typed correctly under all the editors out there.
You have to set a policy, stick to it, and remind people when they stray.
It is not unheard of for an editor to change a sequence of spaces that
ends on a tabstop into a tab---one of my co-workers used to have emacs
set up to do this. It was a problem until we set a policy.
A tab policy that has consistently and painlessly worked for me is
ASCII TAB interpreted as 8 spaces wide. The reasons are several.
Virtually all UNIX text utilities interpret a tab as 8 spaces "out
of the box." Also, in their default configuration, most editors both
display a tab as 8-spaces wide, and insert an ASCII TAB character when
the tab key is pressed. And regardless the sophistication of one's editor
configuration, one must expect some sort of rigamarole given any departure
from 8-space tabs encoded as ASCII TAB. For all those reasons, I think
that a reasonable style guide uses the default, 8-space wide ASCII TABs.
It can be painful to change styles, however, I reckon the pain
is inversely proportional to how strictly the current style guide
is enforced/followed. Last I read any Quagga sources, they were
inconsistently (or else eccentrically) indented. I don't know if that
was the prevailing condition. If that *is* the prevailing condition,
the sources might not be much worse off for having a "style flag day"
(I am thinking of reading CVS diffs) than to be left as-is or to be made
gradually consistent.
I favor the NetBSD style, myself. I have attached it. I have neither
the time nor the inclination to advocate for it. I simply put it out
there as one possibility out of many.
Dave
--
David Young OJC Technologies
dyoung@ojctech.com Urbana, IL * (217) 278-3933