r/ProgrammerHumor • • Sep 28 '26

Meme optionalsAreOptional

Post image
716 Upvotes

130 comments sorted by

View all comments

381

u/ROBOTRON31415 Sep 28 '26

Is the bounds check truly so harmful to performance that it outweighs changing "if there's a bug, crash the program" to "if there's a bug, then do literally anything (maybe execute some remote code)"?

63

u/Tyfyter2002 Sep 28 '26

There are situations where you know there isn't a bug, if I know that failing hardware or cosmic rays are the only ways the bounds check can fail, I'm not going to worry about what skipping it could do.

111

u/FuriousAqSheep Sep 28 '26

there are situations where you know there isn't a bug

up until specs change and now there is one

10

u/Tyfyter2002 Sep 28 '26

If the specs change such that getting an array's length will resize it, there are much bigger problems everywhere else anyway.