3 ms·
Good observation. I seem to recall in one of Linus Torvalds' old rants about C vs C++, he mentioned locality, and how abstracting everything possible in a code
by SkyMarshal 6y ago
Good observation. I seem to recall in one of Linus Torvalds' old rants about C vs C++, he mentioned locality, and how abstracting everything possible in a codebase resulted in loss of locality.
Locality encompasses multiple concepts, one of which is what you mention. Another is the ability to look at any section of code and understand exactly what it does without having to dig through chains of abstractions.
The implication is that locality results in more LOC, but a more tractable codebase, especially as it gets larger and more complex and more difficult for engineers to hold in their head.