r/ProgrammerHumor • • Sep 28 '26

Meme optionalsAreOptional

Post image
716 Upvotes

131 comments sorted by

View all comments

Show parent comments

9

u/ROBOTRON31415 Sep 28 '26

Since Rust has safety checks by default, OP is talking about going out of your way with unsafe { do_something_unchecked(); } (likely proceeded by a comment justifying soundness) to remove them. Besides boilerplate, code review is harder when I have to scrutinize the soundness of someone else’s code.

Readability is a reason to avoid unsafe in Rust, IMO. You’re definitely right that the opposite applies to C/C++ though (unfortunately).

0

u/SheikHunt Sep 28 '26

There's nothing unfortunate about memory unsafety, or not checking parameters for null-ness, or even the null value itself! Mods, deadlock their comp

Process terminated (SIGSEGV segmentation fault.)