4 ms·
40 years ago, C was a small simple language that was faster than most (an important attribute on the hardware available at the time), and the language and it's
by rstuart4133 2y ago
40 years ago, C was a small simple language that was faster than most (an important attribute on the hardware available at the time), and the language and it's standard library was documented by a very small book that was a masterpiece in technical writing. Some behaviour wasn't defined by the language, mostly in the name of efficiency. An example is "x % y" got whether the underlying hardware gave you. The downside of optimising for speed in that way was porting to a different arch was error prone. It isn't memory safe of course, but back them the alternative was assembler which was far worse in all respects, or a garbage collected language with it's overheads that wasn't available on many platforms.
Now, hardware is so fast speed doesn't matter so much. Many languages such as Python come with nice doco and a standard library that ellipses what C provides. Languages like Rust are in the same league speed wise, are memory safe, run on almost as many platforms and have solved the porting issue. Meanwhile the C standards committee redefining "undefined behaviour" from "implementation defined" to "so whatever we damned well please when we detect it" means you almost have to be an language lawyer to know all it's hidden traps. In other words, the language definition has gone from "a pleasant days reading" to "200k words of formal definition only a compiler writer could love".
Like COBOL, C will be around forever, but the days when it was the best choice for most things passed long ago.