Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: H&S (WAS: meaning of continue) Message-ID: <27203:Oct3103:49:2290@kramden.acf.nyu.edu> Date: 31 Oct 90 03:49:22 GMT References: <27261@mimsy.umd.edu> <16103:Oct3003:39:4890@kramden.acf.nyu.edu> <493@taumet.com> Organization: IR Lines: 35 In article <493@taumet.com> steve@taumet.com (Stephen Clamage) writes: > brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >I don't think I've ever used an enum. Why not? Because they aren't in > >the language I think of as C. The result? My code is more portable. > >Would this be true if I used H&S as a reference? I doubt it. > Sounds like you have never actually read H&S. They are careful to > describe what was in old versions of C, common extensions, and what > to do for the most portable code in cases where compilers have > diverged (as with enums). You don't understand. I don't *want* to have to wade through all that stuff about newer C. The language described by the original K&R isn't defined precisely---but it's the language I use, and the language that compilers understand. And that's exactly what I want. I first learned C by writing code in it and asking people when I didn't know how to do something. I didn't read any references, so I didn't hear about enums. Then I found out about K&R. I read it. I still use it as a reference. Maybe I would agree with Chris that H&S is the best reference if I ever needed more precise interpretations than there are in K&R. But I don't. I look at C code with enums the same way as I look at ANSI C, Ada, or any other language I'm familiar with but don't write new code in. When I'm programming in C, I use K&R. > So the answer to your last question, your > code is likely to be very portable among pre-ANSI compilers if you > read and follow the advice in H&S. Your code is likely to be even more portable if you use K&R as your reference. That's all I'm saying. ---Dan Difference between Multics and Ada: Multics was ten years *ahead* of its time.