4 ms·
A lot of the outrage against C seems to be based on the assumption that it gained its prominence either in a vacuum or in a modern context. Oh, young ones, such
by notacoward 5y ago
A lot of the outrage against C seems to be based on the assumption that it gained its prominence either in a vacuum or in a modern context. Oh, young ones, such is not the case. C is a creation of its time as is everything else like Linux and TCP/IP and SCSI. All of their warts seem obvious in 20/22 hindsight, but they were either not obvious at the time or were outweighed by other contemporaneous needs/constraints (usually lack of compute or other power). Bashing C without acknowledging its context and place in computing history only shows an author's shallow ignorance.
On a slightly different topic, few of the problems mentioned in the OP really have much to do with C. I still remember when the interfaces to the original Mac OS (the stuff in Inside Mac, before it got UNIXified) were expressed in Pascal terms. I even vaguely remember MTS interfaces expressed in 360-assembly terms. They were absolutely no better. There is an art to making ABIs and APIs and SPIs and network wire formats and on-disk formats future proof, but it has little or nothing to do with language. The problem is that a bunch of such interfaces exist out there - because they need to exist in concrete form to be useful - that weren't defined with that level of care. It's not much more than coincidence that C happened to be a dominant language in many of those times and domains.
An ABI based on a more "modern" language that involved more detailed types or (even worse) garbage collection would be far far worse for anyone using any other language. C has plenty of problems, but as a notation for expressing an ABI (much like Algol is still sometimes used as a notation for algorithms) it's really not bad.
- smackeyacky 5y agoI think I would go a little further than that. There was a point in the past where machine architectures were so alien that even getting your favourite language bootstrapped on it was a major challenge. The inflection point came when "everything became a PDP-11/VAX" which at least made formerly expensive features affordable and set off a wave of innovation that required some kind of standard (especially the Motorola 68000 and the Intel 386). Now we are so much further along, everything is starting to look like Unix in one form or another. To me, it wouldn't have mattered if the operations systems had converged on NT or VMS, the underlying demand was for Unix like systems and that is where we ended up, to the point where Microsoft have embraced it with WSL and all the big, proprietary OSs of the past are dead or irrelevent. Sure, the ABI problem is real, but 40 years ago this outcome wasn't guaranteed and it's turned out to be absolutely magic in terms of the proliferation of new languages. From my perspective, everything "having to speak C" at a low level is a feature, not a bug. It might not be a perfect model, but it works and a lot of people are familiar with it. That de-facto standardization is what makes modern computing possible.
- pjmlp 5y agoPraising C without acknowledging the 10 years in system programming languages and OS research done outside Bell Labs only shows an author's shallow ignorance in system programming history. Had UNIX been sold at the same price as the competition instead of free beer tapes, and we would be probably using some BLISS, Mesa or PL/I variant instead.
- notacoward 5y agoFirst off, nobody's praising C. Second, those other developments - which I quite likely know better than you do so stop trying to show off or make an implied appeal to authority - are out of scope wrt an article that's specifically about C. I think it would be great if the world had converged on something like Mesa instead of C, but that didn't happen and it's not clear that it would have prevented misguided rants like the OP from being written. Whataboutism is not the same as understanding/respecting essential context.
- pjmlp 5y agoNot showing off, replying on the same tone as your comment. I am even reusing your written style. I am perfectly in scope, given the historical mess that has driven us into this state. That is the only reason why are even discussing about C to begin with.