A long time ago, I wrote “Should you learn C to “learn how the computer works”?”. This was part 1 in a three part series. A year later, I got around to part 2, ““C is not how the computer works” can lead to inefficient code”.
It’s been five more months. I don’t think I really want to write out the third part; I expected this to be a quick series of blog posts, not something that was on my plate for a year and a half. Here’s the thesis of part 3:
Part three is going to show what happens if you make a mistake with the ideas from part two. If you incorrectly assume that C’s abstract model maps directly to hardware, you can make mistakes. This is where UB gets dangerous. While you can take advantages of some properties of the machine you’re relying