The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: arnold@skeeve.com
To: will.senn@gmail.com, clemc@ccc.com
Cc: tuhs@minnie.tuhs.org
Subject: Re: [TUHS] tabs vs spaces - entab, detab
Date: Thu, 04 Mar 2021 11:31:35 -0700	[thread overview]
Message-ID: <202103041831.124IVZTj018003@freefriends.org> (raw)
In-Reply-To: <CAC20D2NUPTSdPC9d4iObeFQvmS9bDuTeZ7TLNnuNGpPFpZn0Ww@mail.gmail.com>

First, no discussion of this issue would be complete without
this video: https://www.youtube.com/watch?v=SsoOG6ZeyUI

Secondly, there are two issues, only partially related.

1. Do I use real tab characters in my code, or just spaces?

2. How many spaces do I want my editor/IDE to use to (a) display tab
characters or (b) expand tabs into, depending upon my answer to (1)
above?

All *nix systems use a "tab stop" of eight characters when printing
tab characters on a terminal or a line printer.  That is pretty hard
to change.

Traditionalists (or at least, I, speaking for myself) use tabs in
their C, C++, and shell code and *must* use tabs in their Makefiles.

Doing so "saved bytes" on the small machines of yesteryear; that
argument is irrelevant today.

I got used to a tab stop of 8 characters for most code and that's
still my personal preference for the C, C++, awk and shell that I write.

The Python world is different; there the use of spaces and a tab stop
of 4 characters is common.  Fortunately, modern editors / IDEs let
you choose the settings to use based on the language you're editing.

I've used a tab stop of 4 spaces for C++ as well and I find that readable
and pleasant. I find anything less than that to be cramped and unpleasant.

I don't remember the details of entab and detab programs on Unix
(other than the expand command) but "Software Tools" from 1976 had
programs to do those exact two jobs, so the issue of going back and
forth between spaces and tabs has been around for a long time.

The short answer is that what you should do boils down to your
preference(s) and the tools you use to edit code.

HTH,

Arnold


Clem Cole <clemc@ccc.com> wrote:

> Oh boy, you do want to pour muddy water on the table.   I generally
> believed in tabs set every 4 spaces.  That's Steven's used in all his UNIX
> books.  Have to ask Rob what and bwk used but I sort of think it was pretty
> similar.  A problem is a lot of people had tabs set at 8 spaces.
>
> Clem
> ᐧ
>
> On Thu, Mar 4, 2021 at 11:53 AM Will Senn <will.senn@gmail.com> wrote:
>
> > 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
> >

  reply	other threads:[~2021-03-04 18:32 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 16:52 Will Senn
2021-03-04 16:59 ` Clem Cole
2021-03-04 18:31   ` arnold [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202103041831.124IVZTj018003@freefriends.org \
    --to=arnold@skeeve.com \
    --cc=clemc@ccc.com \
    --cc=tuhs@minnie.tuhs.org \
    --cc=will.senn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).