• 5C5C5C@programming.dev
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    3 days ago

    I think it’s debatable whether RAII should be called “memory management”. Whether dealing with Rust or modern C++, you don’t need to “manage” the memory beyond specifying a container that will determine its lifecycle behavior, and then you just let it drop.

    You could certainly choose to manage it more granularly than that in Rust or C++, but in the vast majority of cases that would be considered bad practice.

    That’s a qualitatively different user experience than C or pre-2011 boostless C++ where you actually need to explicitly delete all your heap allocations and manually keep track of which pointers are still valid. Lumping both under “memory management” makes the term so broad that it almost loses its significance.

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      11
      ·
      3 days ago

      Yeah, as I understand, in the terms of language design theory, it is technically still “manual memory management”. But since you don’t end up writing malloc() and free(), many refer to it as “semi-automatic” instead, which certainly feels more accurate.