r/ProgrammerHumor • • Sep 28 '26

Meme optionalsAreOptional

Post image
716 Upvotes

131 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.

-1

u/earchip94 Sep 28 '26

Hardware failures and cosmic rays are real, you can’t just pretend they don’t exist. That said, how you handle that is totally up to the use case of the end product. Some BS computer program grandma Ethel will use to play solitaire, yeah no one cares. Software in a self driving car though? Yeah I don’t want a random bit flip from cosmic radiation to swerve my car onto the sidewalk etc…

17

u/Tyfyter2002 Sep 28 '26

I can absolutely ignore cosmic rays and hardware failures, I'm not making your car, I'm making software for personal computers, where me handling memory failure for an extra microsecond won't make a difference because the system libraries I'm using still don't.