From owner-freebsd-current Mon Oct 21 16:24:17 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA22082 for current-outgoing; Mon, 21 Oct 1996 16:24:17 -0700 (PDT) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA22073 for ; Mon, 21 Oct 1996 16:24:14 -0700 (PDT) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.0/CET-v2.1) with SMTP id XAA29176; Mon, 21 Oct 1996 23:23:54 GMT Date: Tue, 22 Oct 1996 08:23:54 +0900 (JST) From: Michael Hancock To: Garrett Wollman cc: John Polstra , current@freebsd.org Subject: Re: In-Reply-To: <9610211437.AA10256@halloran-eldar.lcs.mit.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk For once we agree. ;-) I'll add that inventing tags even when they aren't readily used is a good habit. Regards, Mike Hancock On Mon, 21 Oct 1996, Garrett Wollman wrote: > < said: > > > True, but that's not the point. The point is, at a certain level, > > a type is a type is a type. You shouldn't have to know whether > > it's represented as a struct or as a union or as an array. By > > using a typedef you enforce not knowing the details of the > > representation, making it easier to change that representation in > > the future without having to change a bunch of code. > > Actually, no. typedefs are the ultimate in un-opaqueness. In the C > programming language, I can utter `struct foo' without knowing how > such a structure is defined. I cannot utter `blurfl_t' without it > having previously be defined somewhere. Furthermore, it is not > permissible to twice utter `typedef struct bar bar_t' in a C program. > > The absolute worst-structured program I know (ISI RSVPD) was written > in the `spaghetti typedef' style, and as a result all of its header > files are so entangled with each other that every source file in the > program must include all of them, even in the absence of any > declarations relevant to that source file. I was able to dramatically > clean this up in the version I was working on by simply eliminating > all the typedefs and referring to the structures by their proper tags > (after inventing tags for them) as bwk and dmr intended.