From owner-freebsd-current Mon Oct 21 07:37:46 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA15806 for current-outgoing; Mon, 21 Oct 1996 07:37:46 -0700 (PDT) Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id HAA15799 for ; Mon, 21 Oct 1996 07:37:43 -0700 (PDT) Received: by halloran-eldar.lcs.mit.edu; (5.65v3.2/1.1.8.2/19Aug95-0530PM) id AA10256; Mon, 21 Oct 1996 10:37:39 -0400 Date: Mon, 21 Oct 1996 10:37:39 -0400 From: Garrett Wollman Message-Id: <9610211437.AA10256@halloran-eldar.lcs.mit.edu> To: John Polstra Cc: Michael Hancock , current@freebsd.org Subject: Re: In-Reply-To: <199610210237.TAA05813@austin.polstra.com> References: <199610210237.TAA05813@austin.polstra.com> Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk < 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. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, ANA, or NSA| - Susan Aglukark and Chad Irschick