Conversation

I find that it can be very difficult to track down memory corruption in C++ in general. It's usually far easier for C code since there's a lot less magic and abstraction. Modern C++ is a paradise for latent use-after-free bugs. I'm really not convinced that it improves safety.
4
11
Depends a lot on what kind of code you're writing. I think it's hard enough to avoid memory safety bugs in C. I don't think modern C++ actually succeeds at providing safety beyond avoiding memory leaks and that comes at the cost of implicit use-after-free bugs.
2
1
C++ is a terrible language for building sophisticated abstractions. Lack of proper generics and all the complexity, subtle rules, etc. combined with the culture of layering abstraction upon abstraction doesn't play out well. It's ridiculously painful having to debug bugs we find.
1
2
Debugging UAF is hard enough when you can actually see the calls to free and the functions calling those. Figuring out what layers and layers of strange C++ template contraptions actually do at a low-level to figure it out is horrible. Makes me think the whole thing is crazy.
1
2
Show replies