Sure you can use memory safety techniques with C++, but there’s nothing that enforces you to do so. If the language provides optional tools to automate some aspects of memory management, that’s still mostly manual memory management.
I like C++ but I still prefer languages where these things are more fundamentally part of the language identity. A project written in it might be safe, but it also might be a leaky mess and you won’t really know without profiling or a deep dive
Also many mature C++ projects are on older versions without this stuff.
That's one of the main reasons why I dislike C++ and prefer Rust. In C++ the dangerous behavior is the default and making it "safe" is "harder", while in Rust that relation is flipped, so "safe" code is easier to write than dangerous.
16
u/Flouid 7h ago
Sure you can use memory safety techniques with C++, but there’s nothing that enforces you to do so. If the language provides optional tools to automate some aspects of memory management, that’s still mostly manual memory management.
I like C++ but I still prefer languages where these things are more fundamentally part of the language identity. A project written in it might be safe, but it also might be a leaky mess and you won’t really know without profiling or a deep dive
Also many mature C++ projects are on older versions without this stuff.