4 ms·
C99 and C11 are things; just not the kinds of things for which you update a classic book that describes a reasonably nice language that some of us still prefer
by kazinator 9y ago
C99 and C11 are things; just not the kinds of things for which you update a classic book that describes a reasonably nice language that some of us still prefer to work with (over those things).
From the K&R2's [1988] Preface:
"We have tried to retain the brevity of the first edition. C is not a big
language, and it is not well served by a big book".
Well, that line would go out window with a C11 update. Along with, from the introductory chapter:
C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application.
Oops; the page count in ISO C more than doubled.
But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly
more powerful languages.
The absence of restrictions, whereby C programmers were wrestling particular behaviors out of their code with the cooperation from a particular set of compilers, has lately been turned into a license to wreck non-portable code that used to work for decades.
Who wants to update a classic book in the environment in which you have to warn the reader of undefined behavior at every turn.
- lalaland1125 9y agoHow do you deal with multi-threading in C89? If you rely on POSIX for your threading support, couldn't you argue that you are now dealing with something just as complicated, if not more complicated than C11? Sometimes there is just unavoidable complexity for extremely useful features like thread support. Keeping stuff like that out of the standard doesn't necessary make the language simpler if you are forced to rely on other standards anyways ...
- kazinator 9y ago> How do you deal with multi-threading in C89? Certainly not by means of the abhorrent garbage that has been added to C for threading. POSIX is a standard. POSIX started as a branch of the Unix C library that didn't belong in the language. So for instance that's where "open" and "ioctl" went, while "printf" and "malloc" went to C. There is no need for C to start adding its own versions of POSIX requirements (let alone toy versions); it just adds complexity. Now what it means is that we can end up with some mongrel project where we have POSIX threads being spawned in one module, ISO C threads in another and so on.