From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id c497950c for ; Mon, 13 Jan 2020 00:01:31 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id C0A099BD48; Mon, 13 Jan 2020 10:01:30 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id E3EDD9BD0F; Mon, 13 Jan 2020 10:01:07 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 818719BD0F; Mon, 13 Jan 2020 10:01:05 +1000 (AEST) Received: from fourwinds.com (fourwinds.com [63.64.179.162]) by minnie.tuhs.org (Postfix) with ESMTPS id 4D8B59BCA8 for ; Mon, 13 Jan 2020 10:01:04 +1000 (AEST) Received: from darkstar.fourwinds.com (localhost [127.0.0.1]) by fourwinds.com (8.15.2/8.15.2) with ESMTPS id 00D012n0608444 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Sun, 12 Jan 2020 16:01:02 -0800 Received: from darkstar.fourwinds.com (jon@localhost) by darkstar.fourwinds.com (8.15.2/8.15.2/Submit) with ESMTP id 00D012bC608441 for ; Sun, 12 Jan 2020 16:01:02 -0800 Message-Id: <202001130001.00D012bC608441@darkstar.fourwinds.com> From: Jon Steinhart To: The Eunuchs Hysterical Society In-reply-to: <20200112235051.GG9174@mcvoy.com> References: <202001122225.00CMPc9S085970@tahoe.cs.Dartmouth.EDU> <202001122340.00CNeef0604557@darkstar.fourwinds.com> <20200112235051.GG9174@mcvoy.com> Comments: In-reply-to Larry McVoy message dated "Sun, 12 Jan 2020 15:50:51 -0800." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <608439.1578873662.1@darkstar.fourwinds.com> Date: Sun, 12 Jan 2020 16:01:02 -0800 X-JON-SPAM: local delivery Subject: Re: [TUHS] Tech Sq elevator [ really type-checking ] 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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Larry McVoy writes: > On Sun, Jan 12, 2020 at 03:40:40PM -0800, Jon Steinhart wrote: > > Linux contains several sets of list_for_each_entry() macros that are essentially > > obfuscated for loops that generate inefficient code. > > Very common idiom in any real system. BitKeeper has them as well, they are > used everywhere. They are too useful to not use. The BitKeeper ones give > you most of Perl's list capabilities. I don't see it. In the cases that I've seen so far in linux the only uses are inserting, deleting, and traversing lists. My opinion that anyone who can't write for (p = list; p != NULL; p = p->next) shouldn't be programming, much less in the kernel. To me, type-checking and code clarity are vastly more important. If I want to program in Perl, I do so. When I program in C that's what I do. I do want to be clear that I'm coming at this from a code maintenance angle. Code that I write for my personal use looks way different than what I write professionally. I'm willing to put in more work up front to make sure that other people can easily understand my code because I don't want to be stuck maintaining stuff. And I recognize that unless one is coding a web page with an expected lifespan of 30 seconds the cost of maintenance dwarfs the cost of development. Jon