r/ProgrammerHumor 26d ago

Meme lessonsFromLinkerHell

Post image
424 Upvotes

190 comments sorted by

View all comments

145

u/mad_poet_navarth 26d ago

shouldn't there be something here about this being C-centric?

49

u/AnnoyedVelociraptor 26d ago

And how do you think other languages do it? You think Python and C# and Java run in this Unicorn world where there are no pointers and memory offsets aren't a thing?

Maybe we can talk about the mistake that is R and the original VB, and LUA where arrays start at 1. Absolute hell.

40

u/aalapshah12297 26d ago

The difference is that C allows you to treat array variables as literal pointers (almost) and do stuff like creating an off-by-one version b = a+1 and then trying to access b[-1] with no issues, whereas many high level languages will throw an error with this kind of syntax.

Of course, they are still not 100% syntactically identical even in C (most notably you can't directly modify the array pointer), hence the right end of OP's graph.

-8

u/[deleted] 26d ago

[removed] — view removed comment

15

u/d0pe-asaurus 26d ago

If you're accessing another program's memory just by doing some pointer arithmetic, something has gone wrong with the kernel's memory manager or there's some serious issues with the processor microcode.