From: Christopher Smith <[EMAIL PROTECTED]> Sorry, you're at stage 1. ;-)
No, its that I find the faults of C minor compared to its advantages.
Obvious things to poke at in C: clumsy and error prone macro system (and a sucky preprocessor in general... aren't you tired of having to put guards around all your headers?),
I really don't use macros much. Since C 99 there's no reason to except for headers (we now have const and inline). Yeah, the header guards are mildly annoying but we're talking about 3 lines of boilerplate per .h file, which can be auto-generated.
no easy way to add integer underflow/overflow safety to arithmetic operators when you want it (to do it inefficiently you need to define and use your own functions, to do it efficiently you have to write inline assembly),
True, but how often do you actually need this? Its an extremely rare case to need anything other than an if(variable<0) variable=0; (or return an error).
undefined overflow/underflow behavior with signed types,
Again, this is an absolute corner case. Beyond which its known per processor (is there any processor which doesn't used 2s compliment for normal integers and IEEE for floating point? In the off case there are, I really don't care about them- it still ports to x86, Power, Arm, Sparc and HP's chip).
no boolean type (I think this was fixed in C99, but can't remember),
It was and using 0/not 0 worked just fine.
no support for overloading (even function overloading),
I notes this. However, to add support for function overloading you also need to add type interpretation, which would complicate the language and add failure cases where it makes mistakes. All in all, I prefer not having it.
weak static typing (kind of the worst of all worlds ;-),
WHich compilers fix by reporting as warnings, which I instruct it to treat as errors. That fixes it up to the level of C++'s typing. Unless you want strong typing as in how ML does it, in which case I don't want it.
lack of a built in variable sized array and constant types, but C99 fixed that one. Really, C99 did fixed a number of short comings with
const was never a problem as you had #define (although admittedly it didn't have type checking, so it was a mild weakness). Variable sized arrays are quite possible with libraries, which is where I think it belongs.
Basicly- a few mild issues, some of which are corner cases you use once in a blue moon, compared to never ever having to worry about the myriad of issues that fill books for other languages. I'll gladly take C's side of the tradeoffs.
Gabe -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
