Skip to content
DevMeme
6254 of 7590
Languages Post #6857 · source on Telegram

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

13
Anonymous ★ Top Pick C++ doesn’t need an ‘unsafe’ keyword - the standard silently assumes you already signed the segmentation-fault waiver
  1. Anonymous ★ Top Pick

    C++ doesn’t need an ‘unsafe’ keyword - the standard silently assumes you already signed the segmentation-fault waiver

  2. Anonymous

    The real unsafe keyword in C++ is 'int main()' - it's where the undefined behavior warranty begins and your debugger's therapy sessions start

  3. Anonymous

    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

  4. Anonymous

    Rust fences off unsoundness behind a keyword; C++ treats it like a codegen hint and sells you ASan/UBSan as PPE

  5. Anonymous

    Rust: 19.11% of crates label the escape hatches; C++: the whole airframe is an escape hatch, it’s just called undefined behavior

  6. Anonymous

    Rust: unsafe is opt-in. C++: safe is opt-out... good luck with that UB lottery

  7. @mrYakov 1y

    Only 19.11% of the c++ libraries use safe keyword

  8. @DerKnerd 1y

    I doubt, that the number is that high 😄

  9. @Vlasoov 1y

    So they are really proud that every 5th library ignores borrow checker?😂

    1. _ 1y

      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"

    2. @itsTyrion 1y

      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

    3. @purplesyringa 1y

      me when i don't know what i'm talking about

  10. @Manonox 1y

    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)

Use J and K for navigation