From owner-freebsd-current Sun Oct 20 19:37:17 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA13429 for current-outgoing; Sun, 20 Oct 1996 19:37:17 -0700 (PDT) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id TAA13422 for ; Sun, 20 Oct 1996 19:37:13 -0700 (PDT) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.7.6/8.7.3) with ESMTP id TAA05813; Sun, 20 Oct 1996 19:37:04 -0700 (PDT) Message-Id: <199610210237.TAA05813@austin.polstra.com> To: Michael Hancock Subject: Re: Cc: current@freebsd.org In-reply-to: Your message of "Mon, 21 Oct 1996 10:32:42 +0900." Date: Sun, 20 Oct 1996 19:37:04 -0700 From: John Polstra Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > And it > > is in line with C++ practice, where the struct, class, or union > > keyword is almost never used outside of the declaration. (I know, > > this is C, not C++. But the idea that the name of a type should > > not carry unnecessary information about its representation is a > > valid one.) > > It's questionable to define a typedef just to save typing the word struct. 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. The more opaque a type is, the easier it is to change it later, if you need to. It isn't about saving typing, just as "dev_t" isn't about avoiding typing "unsigned int", and "jmp_buf" isn't about avoiding typing "struct { int _jb[9]; } foo[1];" It's about information hiding. Also, it's important to note that that part of my argument was about the use of typedefs in general, and not specifically about . John