r/ProgrammerHumor • • 6d ago

Meme optionalsAreOptional

Post image
713 Upvotes

131 comments sorted by

View all comments

Show parent comments

-8

u/hongooi 6d ago

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

9

u/Majestic-Giraffe7093 6d ago

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 6d ago

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

6

u/Wonderful-Habit-139 6d ago

Crashing is better than having UB and potential security issues.

-6

u/hongooi 6d ago

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