On 6/7/2016 12:40 AM, Ola Fosheim Grøstad wrote:
On Tuesday, 7 June 2016 at 07:17:04 UTC, Walter Bright wrote:
Granted, one can certainly have other reasons to prefer C++. But memory safety
isn't one of them.
That's true, but memory safety isn't a big problem in C++ if one sticks to what
one can do in @safe code.
Obviously, code that doesn't do unsafe things is safe.
I used to write programs that corrupted memory for years and years in C++. Over
time, I gradually evolved practices that avoided those sorts of bugs, and now I
rarely have a corrupted memory issue in my code.
It's not that C++ got any safer. All that old code will still compile and crash.
It's that I got better, which should not be confused with the language getting
better. I learned not to stick my fingers into the high voltage section of the
power supply.
C++ still suffers from:
http://www.digitalmars.com/articles/b44.html
and probably always will.