3 ms·
C is not precise, not as a model of modern CPUs (they're very different to the PDP-11, and compiler optimisers are very invasive) nor as a precision engineering
by dbaupp 10y ago
C is not precise, not as a model of modern CPUs (they're very different to the PDP-11, and compiler optimisers are very invasive) nor as a precision engineering tool (too many silent footguns and landmines adding a pile of incidental complexity).
It's definitely true that it's sharp and sometimes (currently) the best tool for the job, but don't ignore the reality of its design and limitations when praising it.
- ori_b 10y agoI'm not sure where this meme that C is a direct translation to PDP-11 assembly came from. It's true that there were some quirks in K&R C that came from it (eg, the way that floats were widened to doubles when being passed to functions), but those largely went away with ANSI C. Other than that, C isn't a significantly better match for PDP-11 than it is for x86 or alpha or sparc.
- kbenson 10y agoC is like swinging a very sharp Katana to make small precise incisions. You need to stand far back to have any home of success, and you need to be very precise. With practice, your cuts may be be very precise, but it takes a lot of skill and effort. Until that point (some occasionally thereafter), a lot of accidents happen...