H&S (WAS: meaning of continue)

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Oct 31 14:49:22 AEST 1990


In article <493 at taumet.com> steve at taumet.com (Stephen Clamage) writes:
> brnstnd at 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.



More information about the Comp.lang.c mailing list