So, it's kind of one of those situations where C is the worst major programming language... except for all the others.
Having few "moving parts" is presumably a virtue because it makes systems easy to reason about and thus enables reliability.
The trouble is that C's moving parts (UB) earn you silent data corruption and getting owned by black hats, whereas more abstract languages' moving parts mostly earn you easily debuggable exceptions and possibly a hung process in some cases. GC sometimes earns you extremely difficult-to-diagnose performance issues, which I could certainly do without.
C is perhaps the most reliable in terms of performance but in all other metrics of reliability it is far from number one.
There is no denying the benefits of higher-level languages. I hate having to manually manage memory in C and re-writing basic I/O boilerplate over and over. All the same, I find that, for certain tasks, it's still the best available way to do what I want to do.
I find it ironic that the implementations of many of the languages that people "compare" to C are themselves written in C or teeter at the top of a gigantic software stack whose base is written in... C. This has nothing to do with saying that "C is better". It's just comparing apples and oranges. C is alive and well and is the best tool for certain applications. It might even be around 100 years from now, but knowing it will probably be like knowing Latin, today.
Those languages happen to be written in C just as a convenience, as many people don't want to bother with the extra effort of bootstraping and cross-compiling.
It has nothing to do with C's technical superiority, rather with developer laziness.
7
u/anttirt May 01 '18
Having few "moving parts" is presumably a virtue because it makes systems easy to reason about and thus enables reliability.
The trouble is that C's moving parts (UB) earn you silent data corruption and getting owned by black hats, whereas more abstract languages' moving parts mostly earn you easily debuggable exceptions and possibly a hung process in some cases. GC sometimes earns you extremely difficult-to-diagnose performance issues, which I could certainly do without.
C is perhaps the most reliable in terms of performance but in all other metrics of reliability it is far from number one.