3 ms·
You're saying that switching to "safe" modern C++ is just something you could do at a whim. Learning how to write safe C++ is a hell of a task to undergo, and s
by inDigiNeous 7y ago
You're saying that switching to "safe" modern C++ is just something you could do at a whim. Learning how to write safe C++ is a hell of a task to undergo, and still you are at the mercy of your program crashing even though you have taken careful approach to memory management etc.
Modern C++ is just not a safe language to program with. It is very easy to produce errors that result in segmentation faults, and it takes great care to produce code that works properly even with shared_ptrs and unique_ptrs and so on.
But you are correct that adoption of C++ is higher than Rust, and will continue to be so until some mission critical framework or for example game engine starts to support Rust in as a first citizen language.
Until then, we have modern C++, with all it's quirks and difficulties and lost developer time in figuring out where the hell was that dangling pointer or why the heck was an object not freed correctly, or why did the array access or vector access go off by some value.
Not saying C++ isn't good, it is, but a lot of time is wasted figuring with C++ currently when a lot safer alternative could be used. Unfortunately that is not very realistic in many scenarios yet, although I carefully evalulated Rust also for my current project, the requirement of supporting a C++ game engine just outweighs easily the hassle of having to figure out bridges and bindings and such.
- ncmncm 7y agoWriting safe modern C++ is much easier, and much less work than the old ways. So it is easy to switch, and easy to tell if you are Doing It Right: if it's not clean, safe, and easy, there is a better way.