www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/13/19:22:57

Message-ID: <38F6581B.6AA843EE@hotmail.com>
From: Andrew Hakman <hakmana AT hotmail DOT com>
X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bracketing: A Matter of Style
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000410172457 DOT 24866I AT is> <38f61149 DOT 272044426 AT news DOT warwick DOT net>
Lines: 55
Date: Thu, 13 Apr 2000 23:29:25 GMT
NNTP-Posting-Host: 142.13.16.203
X-Trace: typhoon.mbnet.mb.ca 955668565 142.13.16.203 (Thu, 13 Apr 2000 18:29:25 CDT)
NNTP-Posting-Date: Thu, 13 Apr 2000 18:29:25 CDT
Organization: MBnet Networking Inc.
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

As I mentioned in a previous post though (is this a duplicate? I seem to remember
reading this a while ago), I agree with Eli because if you use RHIDE, and
autoindent, it uses a mixture of tabs and spaces. When you move files from
machine to machine (that all have different settings) that have been autoindented
in this way, it becomes a real pain.

Andrew

Richard Slobod wrote:

> [reposted, as it doesn't seem to have gone through the first time]
>
> Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> >
> >On Mon, 10 Apr 2000, Richard Slobod wrote:
> >
> >> Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> >>
> >> >You took a trivial example.  Try a real-life program, and you'll see
> >> >what I mean.  The problem happens because indentation uses blanks and
> >> >spaces together.  Tabs change their size, but blanks don't.
> >>
> >> Huh?  If you indent with tabs, then you indent with tabs, not a mixture of
> >> tabs and spaces.
> >
> >It depends on the indenting style.  If every indentation level is 2
> >columns deep, then the 4th level will use a tab, the 5th will use a tab
> >and a space, etc.
>
> But if you were messing around with the tab size you obviously wouldn't
> indent like that; you'd make every indent level a tab and just set the tab
> width to your desired indent size.
>
> >Using a tab for each level wastes the line width too quickly, IMHO.
>
> Not if you set the tab size smaller.  That was my original point:  if you
> indent with tabs, you can have the indents as wide or as narrow as you wish.
>
> >> Could you post an example of what you're talking about?
> >
> >This is from the DJGPP library (file name fflush.c):
>
> [fairly lengthy code listing snipped]
>
> But that code was clearly formatted with the inherent assumption that tabs
> are exactly equivalent to eight spaces; someone using a nonstandard tab size
> simply wouldn't have written it that way.
>
> Mixing tabs and spaces in this way will indeed cause parts of the code to be
> misaligned where that assumption is false, but that's not an issue if you
> consistently indent with tabs only.  (For that matter, IMHO, if you want
> something that's guaranteed to be exactly eight spaces wide, it's safest to
> simply use eight spaces.  Admittedly, that will increase the file size a
> bit.)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019