I agree that Rust is the better language because it gives you the safe tools by default.
Smart pointers are no panacea for memory safety in C++ though: even if you use them fastidiously, avoiding raw pointer access, iterator invalidation or OOB access will come for you. The minute you allocate and have to resize, you're exposed.
Yeah that’s definitely true. Anytime I use any C++ api that I did not write or analyze at my best is a shotgun waiting to go off. Hell, even then, that assumes I know enough to catch everything. I’ve recently been doing security analysis of some very popular repos and C++ is terrifying at times.
Rust isn’t perfect but it gives me so much more trust in everything I do.
Smart pointers are no panacea for memory safety in C++ though: even if you use them fastidiously, avoiding raw pointer access, iterator invalidation or OOB access will come for you. The minute you allocate and have to resize, you're exposed.