From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4194 invoked from network); 4 Mar 2021 18:32:27 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Mar 2021 18:32:27 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 9C2D09CA81; Fri, 5 Mar 2021 04:32:21 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 4F5D99CA68; Fri, 5 Mar 2021 04:31:44 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id D76E39CA68; Fri, 5 Mar 2021 04:31:40 +1000 (AEST) Received: from freefriends.org (freefriends.org [96.88.95.60]) by minnie.tuhs.org (Postfix) with ESMTPS id 1841A9CA67 for ; Fri, 5 Mar 2021 04:31:40 +1000 (AEST) X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 124IVak8018004 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Mar 2021 11:31:36 -0700 Received: (from arnold@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 124IVZTj018003; Thu, 4 Mar 2021 11:31:35 -0700 From: arnold@skeeve.com Message-Id: <202103041831.124IVZTj018003@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Thu, 04 Mar 2021 11:31:35 -0700 To: will.senn@gmail.com, clemc@ccc.com References: In-Reply-To: User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [TUHS] tabs vs spaces - entab, detab X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@minnie.tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" 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 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 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 > >