← Back to context

Comment by mrkeen

14 days ago

C++ explicitly supports memory-safe programming. You can choose whether you want to mess around with raw pointer arithmetic.

What safeguards does the language actually put in-place?

> C++ explicitly supports memory-safe programming. You can choose whether you want to mess around with raw pointer arithmetic.

I don't think you know what you're talking about. Managing object ownership through systems like smart pointers is not memory safety. Applications that use smart pointers still suffer from memory issues, and it's possible to adopt object ownership systems that still use raw pointers, such as It's object ownership system.

  • > I don't think you know what you're talking about.

    Right. I sound just like someone talking about how "a language which emphasizes immutability" is an OK replacement for a language with pure functions.

    • The world is much less black and white than you’d like to see it.

      Functions in Haskell including Prelude can throw exceptions which is not reflected in the type signature of the function. That is an effect that makes seemingly pure functions impure.

      You can’t judge a language from a list of buzzwords. You need to look at how it is used in practice.

      2 replies →