4 ms·
C was built as a replacement for assembly programming. It seems low-level today but it does a huge amount of work for you. Call stack manipulation, computing
by blt 12y ago
C was built as a replacement for assembly programming. It seems low-level today but it does a huge amount of work for you. Call stack manipulation, computing offsets for nested struct members, converting arbitrarily complex conditionals into the right branching instructions, coalescing a sequence of expressively named intermediate values into the same machine register... these are the things C does for you. I've never written a serious assembly program but I can imagine how annoying it is to do all that stuff manually. It would be easy to screw up.
I think C has been so successful because it made really good decisions about what to do for you. It eliminated a lot of those busy-work programming tasks without taking away your fundamental control of the machine. Automatic array bounds checking, garbage collection, ... they would have been unthinkable for the original goals of C. The stupid warts are annoying but I think C made fundamentally sound choices of what to do automatically and what to leave up to the programmer.
We all talk about modular, abstract code, but back in the day "modular" meant "use the same calling convention for every int(int, int) function", not "dependency injection". From that perspective, C must have felt like a huge leap in modularity and abstraction from assembler.