🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3942

Re: "Canadian style" of indentation

#3942
From: mfinney
Date: Thu, 07 Sep 1995 04:30
72 lines
3621 bytes
In <42l1th$al8@solutions.solon.com>, seebs@solutions.solon.com (Peter Seebach) writes:
>Why on earth?  If everyone uses tabs, it is trivial for individuals
>to set their own indentation widths.  If everyone uses spaces, it
>is impossible to do correctly.

Its not so simple.  The tab character is rarely used exclusively
for formatting.  Usually there are zero or more tabs followed by
zero or more spaces (and the mixture is less frequently under
your control than might be desirable).  Then use of a tab width
other than the original results in very unreadable code -- it is
not really better than unstructured code.  About all you can do 
is to use a pretty printer on the code.

>Ahh.  So it's a workaround for broken languages.

Not at all, simply a case where the ORIGINAL formatting is
important and cannot be left to the discretion of the editor
which may or may not agree with the compiler.  But I want
that SAME precision when formatting text -- I want to see
the same code layout regardless of editor.

>This is monumentally wasteful.

How?  What is it wasting?  If you mean that it wastes a
small amount of space on the hard disk, I should point
out that I have seen 4G drives advertised for less than
$1000 recently. 

>Tabs are the easiest, fastest, and *correct*
>way to express indentation.

Don't confuse the tab KEY with the tab CHARACTER.  The
tab key is easy and fast -- the tab character is merely a
form of space representation and not important.

> That's what they're for.

No, the tab character is to cause a printing device to move
to the next tab stop -- which somehow (due to CP/M, I
think) because associated with a stop every 8 characters.
But, even prior to CP/M other systems I have used assumed
a stop every 4 characters.  And the general rule is that the
tab stop locations are programmable.

>Nah.  Braces are unambiguous; indentation will get damaged by random edits.

Not that I've found.  I use nothing but spaces and I do some
REALLY massive edits upon occassion (I get some tasks at
work simply becuase I type fast and can make massive edits)
and don't see loss of indentation as a problem.  What edits do
you make that cause such loss?

>Lucky you.  What if the change is subtle, accidental, and occurs during
>serious restructuring?  No thanks, I'll favor a layout-proof language any
>day.

No luck is involved.  I archive source, and make backup copies at
every significant point.  It takes virtually no effort and has major
paybacks.  The subletly of the change is irrelevant -- if it is wrong
you can go back to the last signifcant version.

Not to mention that you can use a differencing program if there
are other edits you wish to preserve.  Also, most editors have
nearly unlimited UNDO/REDO features available.  Use them.

But I really don't expect that such a change will be a problem
when using spaces and will not be a problem when using tabs.
Give me an example of such an editing mistake that could be
expected to be made with some reasonable proability.


Michael Lee Finney
Technical Details
Message-ID: <42lsgm$8fc@mujibur.inmind.com>
Path: arc1-ca.pugleaf.net!mujibur.inmind.com!usenet
References: <41g464$6vv@ruby.ucc.nau.edu> <4255vr$12@mujibur.inmind.com> <810138845snz@soliton.demon.co.uk> <42d3e7$aks@mujibur.inmind.com> <42l1th$al8@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mujibur.inmind.com!usenet
From: mfinney@inmind.com
Newsgroups: comp.std.c
Subject: Re: "Canadian style" of indentation
Date: 7 Sep 1995 04:30:14 GMT
Organization: In Mind, Inc.
Message-ID: <42lsgm$8fc@mujibur.inmind.com>
References: <41g464$6vv@ruby.ucc.nau.edu> <4255vr$12@mujibur.inmind.com> <810138845snz@soliton.demon.co.uk> <42d3e7$aks@mujibur.inmind.com> <42l1th$al8@solutions.solon.com>
Reply-To: mfinney@inmind.com
NNTP-Posting-Host: finneyman.inmind.com
X-Newsreader: IBM NewsReader/2 v1.2