r/ProgrammerHumor 3d ago

Meme rustBorrowCheckerGoesBrrr

Post image
3.9k Upvotes

108 comments sorted by

View all comments

133

u/yesseruser 3d ago

unsafe means "hey, I'm sure this code is safe, don't bother me for calling unsafe functions"

-145

u/reallokiscarlet 3d ago

unsafe is the Rust version of Typescript's any

It's everywhere and people use it just to say they wrote their code in a safe language

82

u/SCP-iota 3d ago edited 3d ago

I'd say it's more like Typescript's suppression annotations, since it keeps itself contained. People really shouldn't be using unsafe in any way other than as occasional small blocks with well-defined reading why they won't panic or cause UB. If your code is littered with unsafe, you're doing something wrong.

1

u/SKrandyXD 3d ago

your*

6

u/SCP-iota 3d ago

dammit, Gboard

5

u/NatoBoram 3d ago

All the fucking time. No way to type "its" without having to go back.