8 ms·
As a counterpoint, Alex Stepanov (the primary designer and implementer of the C++ Standard Template Library), had this crucial insight about the C programming l
by StephenFalken 12y ago
As a counterpoint, Alex Stepanov (the primary designer and implementer of the C++ Standard Template Library), had this crucial insight about the C programming language pervasiveness:
Let's consider now why C is a great language. It is commonly believed that C is a hack which was successful because Unix was written in it. I disagree. Over a long period of time computer architectures evolved, not because of some clever people figuring how to evolve architectures---as a matter of fact, clever people were pushing tagged architectures during that period of time---but because of the demands of different programmers to solve real problems. Computers that were able to deal just with numbers evolved into computers with byte-addressable memory, flat address spaces, and pointers. This was a natural evolution reflecting the growing set of problems that people were solving. C, reflecting the genius of Dennis Ritchie, provided a minimal model of the computer that had evolved over 30 years. C was not a quick hack. As computers evolved to handle all kinds of problems, C, being the minimal model of such a computer, became a very powerful language to solve all kinds of problems in different domains very effectively. This is the secret of C's portability: it is the best representation of an abstract computer that we have. Of course, the abstraction is done over the set of real computers, not some imaginary computational devices. Moreover, people could understand the machine model behind C. It is much easier for an average engineer to understand the machine model behind C than the machine model behind Ada or even Scheme. C succeeded because it was doing the right thing, not because of AT&T promoting it or Unix being written with it.
- gilgoomesh 12y agoI think there's a cause and effect fallacy in that statement. C is a good representation of an abstract computer because alternative representations have died out. C (and very similar imperative languages) keep a strong arm pressure on CPU designers to work well with C. I've spent some time working on VLIW architectures where C is a terrible abstract representation of the CPU's inner workings. Get anything done efficiently was awful and required huge, cumbersome, carefully structured intrinsics. Or raw assembly. Is this is fault of VLIW? Not really. Its mostly the reality of a world that would rather run C code than use VLIW architectures. So we don't have VLIW or other CPU architectures that don't work well with C.
- latiera 12y agoThis is great.... NOT. "people could understand the machine model behind C" -> that is why every substantial C program is ridden with undefined behavior, overflows, memory leaks, race conditions.... "C succeeded because it was doing the right thing" -> If the right thing is giving rise to the software exploit industry and causing billions in damages.. I suggest you read Richard Gabriel's "Worse is Better" (http://www.jwz.org/doc/worse-is-better.html http://www.jwz.org/doc/worse-is-better.html) and forget anything that Stepanov has to say on the matter. Either he is utterly clueless or a dangerous imbecile. C has been in use for decades now. We only have to look at the facts, not listen to fallacies that various cretins feel the urge to proclaim.
- pjmlp 12y agoI don't agree with him. If UNIX had not succeeded, C would have failed in the industry. Back in th 8 and 16 bit days of the home computer systems, I never felt the need to use C. I could touch all the hardware using Assembly, Turbo Pascal. Apple was using Object Pascal for system programming and a few friends were doing Amiga games with Amos. Sure I did learn C at high school, but it only became a requirement for the university work that had to run on UNIX systems.