3 ms·
If may add a 6th reason, the low-level nature of C code gives you a very realistic model of computation---you see how long operations take because you often hav
by ivan_ah 12y ago
If may add a 6th reason, the low-level nature of C code gives you a very realistic model of computation---you see how long operations take because you often have to do them manually.
High level languages like python hide this complexity from you (e.g. python dictionaries / arrays / string manipulations). They make life easier, but in a isolated-from-the-machine-in-plastic-wrap kind of way, whereas C makes me feel I'm touching the CPU.
- tbirdz 12y agoThis is true up to a point. But C is based on an abstract model of a machine, which doesn't really map closely to today's machines. For example, C's memory model basically assumes a contiguous array of bytes, but with modern systems there is a huge difference in speed between main memory and L1,L2,L3 cache. So in order to avoid costly cache misses you have to access your data in cache friendly ways, as all memory accesses are not equal as in C's model. Also consider things like vectorization (SSE, AVX, NEON, etc), memory fences, atomic operations, or threading which are not in C's machine model. Various intrinsics, standards (POSIX), and libraries exist to remedy this, but the fact remains that's C's abstract machine model is getting increasing distant from actual modern hardware.