Rust dev cites unsafe stats while C++ cat enjoys oblivious dinner smugly
Description
Side-by-side meme using the classic “woman yelling at cat” template. Left panel: two women from a reality-TV scene (faces blurred) with one leaning forward, arm outstretched, angrily pointing; caption above reads “Only 19.11% of all rust libraries use unsafe keyword”. Right panel: the famous white cat sitting at a dinner table (face blurred) looking unimpressed in front of a half-eaten salad; caption above reads “None of the c++ libraries use the unsafe keyword”. The humor contrasts Rust’s explicit ‘unsafe’ escape hatch with C++’s implicit freedom to cause undefined behavior, highlighting veteran debates on memory safety, type systems, and low-level programming responsibility
Comments
13Comment deleted
C++ doesn’t need an ‘unsafe’ keyword - the standard silently assumes you already signed the segmentation-fault waiver
The real unsafe keyword in C++ is 'int main()' - it's where the undefined behavior warranty begins and your debugger's therapy sessions start
The real joke is that C++ developers have been writing 'unsafe' code for decades without needing a keyword to mark it - when everything is unsafe by default, nothing is. Meanwhile, Rust developers meticulously track that 19.11% like it's a code coverage metric, because in Rust, explicitly opting out of safety guarantees is the exception that proves the rule. It's the difference between a language that assumes you know what you're doing with raw pointers and one that makes you pinky-swear you understand the consequences before letting you segfault
Rust fences off unsoundness behind a keyword; C++ treats it like a codegen hint and sells you ASan/UBSan as PPE
Rust: 19.11% of crates label the escape hatches; C++: the whole airframe is an escape hatch, it’s just called undefined behavior
Rust: unsafe is opt-in. C++: safe is opt-out... good luck with that UB lottery
Only 19.11% of the c++ libraries use safe keyword Comment deleted
I doubt, that the number is that high 😄 Comment deleted
So they are really proud that every 5th library ignores borrow checker?😂 Comment deleted
I'd be interesting to have statistics of what unsafe is used for… Anyways it's a bit more complex that that, at the very least it's "using features that may allow bypassing the borrow checker" Comment deleted
I'd this somehow isn't bait: This isn't about irgnoring borrow checker but if you work with a FFI and/or OS shenanigans you often need unsafe Comment deleted
me when i don't know what i'm talking about Comment deleted
I would rather have unsafe in libs than RefCells and shit like that, fastest solutions aren't always in the "borrow checker pleasing" subset of programs. (I could use RefCell for each cell in a grid for a water simulation, but that introduces runtime costs, so I had to use get_many_mut_unchecked + similar methods and unsafe) Comment deleted