• vzq@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    the fact that it’s possible (and not even especially difficult) to misuse smart pointers badly enough to produce program crashes and undefined behavior is still a fundamental weakness of C++ as a language

    I would argue it’s the natural state of C++. Crashes and UB lurk in every shadow, ready to pounce upon the unwary programmer.

    It’s a powerful tool, but it’s not very forgiving.

    • 5C5C5C
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I agree that it’s the natural state of C++, and my point is that this is makes C++ not a good choice when an alternative that has all the strengths of C++ and none of the weaknesses exists.