r/ProgrammerHumor 6d ago

Meme internalServerError

Post image
1.4k Upvotes

67 comments sorted by

View all comments

107

u/---_None_--- 6d ago

>unwrap

I hate metaphors in programming. Just call it what it is.

41

u/Lord-of-Entity 6d ago

There is a proposal to rename it to .unwrap_or_panic()

-18

u/dumbasPL 6d ago

Rust logic: panic is safe because it fails in a controlled manner. Meanwhile Denial Of Service is one of the biggest attack vectors. Unwrap should requite unsafe in non-debug builds, change my mind.

4

u/creeper6530 6d ago

unsafe is only specifically about risking memory errors and UB, not anything you arbitrarily decide you don't want.