Why learn C? (O'Reilly Radar)
Posted Jul 1, 2012 2:55 UTC (Sun) by vonbrand
In reply to: Why learn C? (O'Reilly Radar)
Parent article: Why learn C? (O'Reilly Radar)
Multiple return values.
You can return a struct... and multiple return values would require handling multiple values all over the place (asignments, comparisons, ...). Nifty, but definitely not "low level." C is OK as is here.
Less stupid preprocessor, more compile-time evaluation!
The preprocessor is decidedly not stellar. Better use m4(1) perhaps? Or just chuck it altogether (given const and enums, and inline functions, its use is mostly for #include nowadays). Plus current compilers are quite smart at getting rid of useless code and constant folding, so "compile time evaluation" is given much more than you perhaps realize.
Precise alignment and offsets of structure fields (constant and "modulo by" constraines).
Sorry, but if you want a low-level, efficient language, you have to give the compiler leeway to accomodate the architecture's quirks.
Less "undefined behaviour" beartraps!
to post comments)