The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] tabs vs spaces - entab, detab
@ 2021-03-04 16:52 Will Senn
  2021-03-04 16:59 ` Clem Cole
                   ` (6 more replies)
  0 siblings, 7 replies; 78+ messages in thread
From: Will Senn @ 2021-03-04 16:52 UTC (permalink / raw)
  To: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

OK. So, I've been trying to decide (for the last time, I swear) whether 
to use tabs or spaces in my code... I did a quick pulse-check on the 
state of argument and it appears to be alive and well in 2021. My 
question for y'all is, was there a preference in the very early days or 
not? I saw an article talking about the 20 year feud, but that's not my 
recollection. In 1994, nobody agreed on this, but I'm sure it predates 
my entree into the field. I'm thinking the history of entab and detab 
are somehow related, but I've been wrong on these sorts of thoughts 
before. What say you?

Will

[-- Attachment #2: Type: text/html, Size: 850 bytes --]

^ permalink raw reply	[flat|nested] 78+ messages in thread
* [TUHS] tabs vs spaces - entab, detab
@ 2021-03-05 16:44 M Douglas McIlroy
  2021-03-05 19:29 ` Greg A. Woods
  0 siblings, 1 reply; 78+ messages in thread
From: M Douglas McIlroy @ 2021-03-05 16:44 UTC (permalink / raw)
  To: tuhs

> The reason to use tab was file size for one

This is urban legend. The percentage of 512-byte blocks that
tabs would save was never significant.

(I agree that tabs and--especially--newlines can significantly
compress fixed-field formats from  punched-card tradition, but
on the tiny Unix systems where tab conventions were
established, big tabular files were very rare.)

Tabs were a convenience for typists. Of course the tty driver
could have replaced them with spaces, but that would have
foreclosed important usage such as tab-separated fields and
run-time-adjustable tab stops tab-separated fields.

(I have run into latter-day trouble with selecting a space-substituted tab
from a screen, only to discover that I was copying or searching for spaces
instead of the tab.. That's not  an intrinsic problem, though. Editors like sam
handle it without fuss.)

Doug

^ permalink raw reply	[flat|nested] 78+ messages in thread
* [TUHS] tabs vs spaces - entab, detab
@ 2021-03-05 22:50 Norman Wilson
  0 siblings, 0 replies; 78+ messages in thread
From: Norman Wilson @ 2021-03-05 22:50 UTC (permalink / raw)
  To: tuhs

I could chip in with my own strong opinions about code formatting,
but I think others have already posted plenty of such boring off-topic
fluff.

A straight answer to Will's original question might be interesting,
though:

The oldest extant UNIX code samples I know are those the TUHS archive,
in Distributions/Research/Dennis_v3/nsys.tar.gz; they're a very old
kernel source tree.  There are plenty of tabs there.

This matches my memories of the V7-era source code, and of what I saw
people like ken and dmr and rob and bwk and pjw typing in the not-
so-early days of the 1980s when I worked with them.

Tabs were generally eight spaces apart.  In code, nobody worried about
the effects on long lines, because the coding style was spare and
didn't run to many deeply-nested constructs, so lines didn't get that
long.  (Maybe it was considered a feature rather than a bug that
deep nesting and deep indentation looked messy, because it wasn't
usually a good idea anyway.)

I can't speak to original motivations, but I suspect my own reasons
for using tabs aren't too different:
-- It's quicker and faster to type than multiple spaces
-- When not at the start of the line, tabs more often preserve
alignment when earlier part of the line are edited
-- Back when terminals were connected at speeds like 110 or 300 bps
(I am old enough to have experienced that, especially when working
from home), letting the system send a tab and the local terminal
expand it was a lot faster, especially when reading code (more likely
to have lots of indentation than prose).  Not every device supported
tabs, but enough did that it made a real difference.

UNIX didn't originate any of this.  I used tabs when writing in FORTRAN
and ALGOL/SIMULA and MACRO-10 on the TOPS-10 system I used before I
encountered UNIX.  So did all the other hackers I knew in the terminal
room where we all hung out.

I don't know the history of entab/detab.  Neither appears to have
been around in the Research systems; they're not in V7 and they're
not in V10.  V7 does.

As an aside, the V10 manual has a single manual page for col, [23456],
mc, fold, and expand.  It's a wonderful example of how gracefully
Doug assembled collections of related small programs onto a single
page to keep the manual size down.  Also of his gift for concise
prose: the first sentence is

These programs rearrange files for appearance's sake.

which is a spot-on but non-stodgy summary.  I wish I could write
half as well as Doug can.

And as an almost-joke, it's a wonder those programs haven't all been
made into options to cat in modern systems.

Norman Wilson
Toronto ON

^ permalink raw reply	[flat|nested] 78+ messages in thread
* Re: [TUHS] tabs vs spaces - entab, detab
@ 2021-03-07  2:53 Nelson H. F. Beebe
  0 siblings, 0 replies; 78+ messages in thread
From: Nelson H. F. Beebe @ 2021-03-07  2:53 UTC (permalink / raw)
  To: tuhs

Here is a link to the 1897 bill of the Indiana State Legislature
that legislated a new value for $\pi$:

	https://journals.iupui.edu/index.php/ias/article/view/4753/4589

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 78+ messages in thread

end of thread, other threads:[~2021-03-17  5:11 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 16:52 [TUHS] tabs vs spaces - entab, detab Will Senn
2021-03-04 16:59 ` Clem Cole
2021-03-04 18:31   ` arnold
2021-03-04 19:23     ` Nemo Nusquam
2021-03-04 19:37       ` Steve Nickolas
2021-03-04 19:50         ` Rob Pike
2021-03-04 21:20           ` Robert Clausecker
2021-03-04 21:25           ` Will Senn
2021-03-05  9:58             ` John Gilmore
2021-03-06 21:31               ` Dave Horsfall
2021-03-06 21:38                 ` Larry McVoy
2021-03-06 22:05                   ` Clem Cole
2021-03-15  3:02                     ` John Cowan
2021-03-15 18:15                       ` Steffen Nurpmeso
2021-03-15 21:19                         ` Bakul Shah
2021-03-15 23:47                           ` Steffen Nurpmeso
2021-03-16  3:10                             ` Earl Baugh
2021-03-15 21:08                       ` Dave Horsfall
2021-03-15 21:12                         ` Steve Nickolas
2021-03-15 21:24                           ` Dave Horsfall
2021-03-15 22:06                             ` Adam Thornton
2021-03-16 13:25                             ` arnold
2021-03-17  5:10                       ` Greg 'groggy' Lehey
2021-03-06 21:40                 ` Steve Nickolas
2021-03-04 18:48   ` emanuel stiebler
2021-03-05  0:44     ` John Cowan
2021-03-05  0:55       ` Larry McVoy
2021-03-05  1:09         ` George Michaelson
2021-03-05  1:21           ` Larry McVoy
2021-03-05  1:29             ` Richard Salz
2021-03-04 18:33 ` John P. Linderman
2021-03-04 21:24 ` Greg 'groggy' Lehey
2021-03-04 21:27   ` Will Senn
2021-03-04 21:29     ` Greg 'groggy' Lehey
2021-03-04 21:42       ` Will Senn
2021-03-04 21:48       ` John P. Linderman
2021-03-04 22:08         ` Andy Kosela
2021-03-04 22:12           ` Greg 'groggy' Lehey
2021-03-05 14:13             ` Steffen Nurpmeso
2021-03-05 20:24               ` John Cowan
2021-03-05 21:51                 ` Bakul Shah
2021-03-06 23:43                 ` Steffen Nurpmeso
2021-03-05  0:15           ` Jon Steinhart
2021-03-06 21:22           ` Dave Horsfall
2021-03-06 23:58             ` Bakul Shah
2021-03-07  0:03               ` Jon Steinhart
2021-03-07  0:25               ` Steve Nickolas
2021-03-07  9:16               ` Brantley Coile
2021-03-05  9:50         ` [TUHS] tunefs -m 5% John Gilmore
2021-03-05 15:01           ` Grant Taylor via TUHS
2021-03-05 15:32           ` Theodore Ts'o
2021-03-06  1:18             ` Greg 'groggy' Lehey
2021-03-06  1:52               ` Warner Losh
2021-03-06 21:45                 ` Dave Horsfall
2021-03-06 22:03                   ` Larry McVoy
2021-03-09  4:59                     ` Greg 'groggy' Lehey
2021-03-06 23:52                   ` David Barto
2021-03-06  1:16           ` Greg 'groggy' Lehey
2021-03-04 22:10     ` [TUHS] tabs vs spaces - entab, detab Greg A. Woods
2021-03-05  1:41 ` alan
2021-03-05  1:55 ` alan
2021-03-05  2:06   ` Will Senn
2021-03-05 17:08     ` Clem Cole
2021-03-05 17:19       ` Richard Salz
2021-03-05 19:39         ` Lawrence Stewart
2021-03-05 19:51           ` Dan Halbert
2021-03-08  1:52       ` Will Senn
2021-03-05 16:43 ` Scot Jenkins via TUHS
2021-03-05 22:23   ` Bakul Shah
2021-03-06 20:51 ` Dave Horsfall
2021-03-06 21:01   ` Jon Steinhart
2021-03-06 21:19     ` Larry McVoy
2021-03-06 22:01       ` Clem Cole
2021-03-05 16:44 M Douglas McIlroy
2021-03-05 19:29 ` Greg A. Woods
2021-03-06 23:21   ` Steffen Nurpmeso
2021-03-05 22:50 Norman Wilson
2021-03-07  2:53 Nelson H. F. Beebe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).