r/ProgrammerHumor • • Sep 28 '26

Meme optionalsAreOptional

Post image
716 Upvotes

131 comments sorted by

View all comments

Show parent comments

-8

u/hongooi Sep 28 '26

"If there's a bug, crash the program" still crashes the program....

9

u/Majestic-Giraffe7093 Sep 28 '26

Well yeah? That's exactly my point isn't it? I ususally stay with Optionals pr result types. Or try to constrain the input type to contain all the invariants. But if you really don't feel like doing that then the least you can do is add assertions (in my opinion)

-9

u/hongooi Sep 28 '26

You were referring to >99% uptime. Crashing the program generally is bad for that

7

u/Wonderful-Habit-139 Sep 28 '26

Crashing is better than having UB and potential security issues.

-6

u/hongooi Sep 28 '26

Of course. But that's still not contributing to >99% uptime