Elektrine lite

← Feed

@mcv@lemmy.zip

Post #3531222

2026-07-02 09:43 UTC

Changeable state in an immutable data type? Is… Is that a good idea? I don’t know Rust, but I can tell that the criticism in these image is mostly bullshit. But changing immutable state sounds like a bad idea to me. Is there something I’m missing?

Replies (2)

  • @ZILtoid1991@lemmy.world 2026-07-02 10:23

    I have a guess that it was added as a workaround the moment Rust was marketed as a general C++ replacement, especially as people started to realize overusing the FP paradigm also has its downsides, it’s not unique to OOP.

    Open ##3531798

  • @rtxn@lemmy.world 2026-07-02 14:53

    “We spent two decades making sure the compiler will never produce memory-unsafe code. It requires a lot of nigh-illegible boilerplate code to even compile and adds massive cognitive load, but the effort will be worth it. Anyway, here’s a type whose only purpose is to disable all of that shit.”

    Open ##3536119