Skip to Content.
Sympa Menu

freetds - Re: indent(1) bent

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT netexpress.net>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: indent(1) bent
  • Date: Wed, 23 Oct 2002 11:43:25 -0500

On Wed, Oct 23, 2002 at 10:43:42AM -0400, Lowden, James K wrote:
> I don't see what "the majority of terminals in their default configuration"
> has to do with anything. Good grief! I should edit my code according to
> what xterm(1) thinks is a reasonable tabstop? Please.

> Tabs are a *feature*. If we use tabs, for the most part we can set our
> tabstops where we want to and let each see the code with his preferred
> amount of lefthand whitespace.

> The problem arises when people lean on the spacebar instead of the tab key,
> or use an editor that writes N spaces every time <tab> is pressed. I've
> always thought the latter was a braindead nonfeature, because it's
> asymmetrical: press <tab> once and you have to press <backspace> N times to
> undo it. Strictly dopey. Also, it inevitably leads to off-by-one
> (indentation) errors, because people get it wrong from time to time.

> I know, there are times when you need to line things up, like when you do
> something like:
>
> if (blah giant test
> || other possibility) {
> [your code here]
> }

> which, btw is why God intended tabstops to be at 3. ;) My assertion is, if
> you do this and it doesn't line up according to the prescribed tabstop --
> currently 5 -- then you did it wrong. If you like (as I do) something other
> than 5, correctly indented code will look a little wavy in those places.
> That's not such a high price to pay for everyone else's flexibility.

> For the record, I use 3 for C, 4 for perl, and 8 for SQL. I'm OK with 4 or
> 5, in the spirit of community.

God's own tabwidth is four, I tell you.

The nice thing about tabs is that, as long as they're used *consistently*
and *well* (tab to indent code blocks, spaces if things need to be
indented to line up /within/ a code block), they can satisfy everyone
regardless of tabwidth preference. But if the basic rules aren't
followed, it's certainly more of a mess than if people were just using
spaces. :)

Steve Langasek
postmodern programmer

Attachment: pgpflvmO6Ih7w.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page