[Gllug] vi indenting

Tom Gilbert tom at linuxbrit.co.uk
Wed Dec 19 15:06:48 UTC 2001


* tet at accucard.com (tet at accucard.com) wrote:
> 
> >Do you have any idea how annoying that is when a file is indented by
> >people with their tabstop set to different values?
> 
> Probably almost as annoying as it is when a file is indented with
> differing numbers of spaces, I'd imagine. For natural language
> texts, then sure, indent with spaces, but I've yet to see a single
> valid argument (including jwz's) for indenting code with anything
> but tabs. Maybe when you've had to work on code that's indented
> with a mix of 2, 3, 4 and 5 spaces in the same file, you'd agree.
> I have, all by different authors, of course, and it wasn't a pleasant
> experience.

I think you missed the point there.

It's not about people indenting different numbers of times (whether
spaces or tabs).

What's annoying about tabs is that to get reasonable indenting, people
mix them with spaces. (Say your tabstop is 4 but for nice alignment,
you want the next line to start at position 6, so you do a tab and 2 
spaces).

It's mixed tabs/spaces that breaks and is awful, because as soon as
someone with a different tabstop comes along (e.g. 2), the tabs and
spaces don't line up any more (you now have 1 tab and two spaces == 4
characters, lining up with the 2 tab indented line above, blech!).

I indent with spaces, and reject patches sent to me with tabs in, for
good reason.

Of course it's annoying if two people indent the same file differently
in different places, but that would be annoying whether it was tabs,
spaces or overhanging/non-overhanging braces. That's why they wrote
indent(1).

Tom.
-- 
   .^.    .-------------------------------------------------------.
   /V\    | Tom Gilbert, London, England | http://linuxbrit.co.uk |
 /(   )\  | Open Source/UNIX consultant  | tom at linuxbrit.co.uk    |
  ^^-^^   `-------------------------------------------------------'

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list