Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!ucbcad!zen!cory.Berkeley.EDU!iverson From: iverson@cory.Berkeley.EDU (Tim Iverson) Newsgroups: news.admin Subject: Re: How (not) to Program in C (was Re: PD C as solution to binary groups) Message-ID: <3411@zen.berkeley.edu> Date: Wed, 31-Dec-69 18:59:59 EDT Article-I.D.: zen.3411 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Sat, 29-Aug-87 03:05:32 EDT References: <6960@g.ms.uky.edu> <3725@ncoast.UUCP> <2527@whuts.UUCP> <2639@hoptoad.uucp> <1101@laidbak.UUCP> <3367@zen.berkeley.edu> <4261@ncoast.UUCP> Sender: news@zen.berkeley.edu Reply-To: iverson@cory.Berkeley.EDU.UUCP (Tim Iverson) Organization: University of California, Berkeley Lines: 26 In article <4261@ncoast.UUCP> allbery@ncoast.UUCP (Brandon Allbery) writes: >As quoted from iverson@cory.Berkeley.EDU (Tim Iverson): >+--------------- >| [...] Admittedly I don't often use unions, >| but occasionaly I found them essential. >+--------------- > >Unions -- are NEVER necessary. The only legal use of a union is to shrink a >variable which can contain a number of different types of values; a struct >will work just as well, at a (possibly large) space penalty. [...] Well, you ate shoe leather on this one. I had to design a data structure for a time series where a wasted *byte* meant a wasted 80Mb on disk (that was not a typo - 80Mb). In this case, I think you'll agree, unions were essential. Sometimes the "possibly large" becomes the "impossibly huge". As for Standard C Programming, I'm all for it - as long as my code is used as the standard. The problem is that every other C programmer feels the same way about his code. What we need to do is gang up on one programmer at a time, ya' know, divide and conquer! (i.e. let's just drop this 'standard C' nonsense - let the ANSI commitee worry about it.) - Tim Iverson iverson@cory.Berkeley.EDU ucbvax!cory!iverson