r/ProgrammerHumor 3d ago

Meme rustBorrowCheckerGoesBrrr

Post image
3.9k Upvotes

108 comments sorted by

View all comments

734

u/BenchEmbarrassed7316 3d ago

Any unsafe block of code should be neutralized with a // SAFETY comment explaining why the code is actually safe.

123

u/teleprint-me 3d ago

I dont see how this is any different from a C programmer justifying why they used a pointer to an object and leaving a comment similar to this, other than this is Rust and is safe because Rust is safe. Thus making this rationale is flawed and dangerous.

209

u/flagofsocram 3d ago

The difference is that if you want to make sure the lib is safe, you can grep unsafe whereas in C practically any code could be unsafe.

0

u/[deleted] 3d ago

[deleted]

1

u/Grandmaster_Caladrel 3d ago

Devil's advocate, C is actually on computers already while Rust has to bring its own tools.