Memory unsafe C++ is a choice. With modern C++ you have no excuse for accessing raw pointers or arrays without range checking if memory safety is a priority.
As I said: There are tools in place in modern C++ that are designed to catch the errors you make. If you are using a raw pointer when you could have used a reference, or accessing an array without range checking, those are choices you’ve made. They may be valid choices in your use-case, but don’t go complaining that the language is “unsafe” when it gives you the option to code with guard rails and you choose to forgo them.
I’m a full time C++ developer, mostly doing high performance data processing and some visualization and TUI tools, and as someone loving C++, it’s not as simple as you frame it. In sufficiently complex code you still have to deal with these problems.
Rust has some good mechanisms in place to avoid these and there are things on the way for c++26 though.
Memory unsafe C++ is a choice. With modern C++ you have no excuse for accessing raw pointers or arrays without range checking if memory safety is a priority.
Yeah, just don’t make any mistakes and you’ll be fine. Come on guys, how hard can it be?
As I said: There are tools in place in modern C++ that are designed to catch the errors you make. If you are using a raw pointer when you could have used a reference, or accessing an array without range checking, those are choices you’ve made. They may be valid choices in your use-case, but don’t go complaining that the language is “unsafe” when it gives you the option to code with guard rails and you choose to forgo them.
I’m a full time C++ developer, mostly doing high performance data processing and some visualization and TUI tools, and as someone loving C++, it’s not as simple as you frame it. In sufficiently complex code you still have to deal with these problems. Rust has some good mechanisms in place to avoid these and there are things on the way for c++26 though.