3 ms·
>> Who Says C is Simple? > I do. I disagree. C comes with a lot of edge cases and subtleties that can surprise even people like myself who 'know' C. Some exa
by cygx 13y ago
>> Who Says C is Simple?
> I do.
I disagree. C comes with a lot of edge cases and subtleties that can surprise even people like myself who 'know' C.
Some examples: Exact semantics of restrict, C99 inline semantics (eg I wasn't aware that it's possible to make a non-extern/non-static inline definition into an extern one with a single redeclaration), effective typing rules and whether it's possible to circumvent them, whether or not it's undefined behaviour to cross boundaries of the sub-arrays of a multi-dimensional array if it doesn't happen in a single expression, ...
- rdtsc 13y agoThe difference is between gimmicky ways one can use ambiguity to produce convoluted edge cases vs knowing enough to do actual work. Sure C being low level and and having a relatively short specification is ripe for compiler specifics and hardware specific hacks. But still think it has the basic core defined and that is pretty small. With C++ and its typical libraries it is a bit different. It has so many features (templates, classes, streams, friends, shared pointers, unique pointers, distructors, constructors, polymorphism rules, and combination of those) that code gets complicated without using obscure features, just sticking to the standard ones gets hairy and needs someone who knows the whole spec.