by brokencode · 3y ago · 0 comments
Can we at least agree that Rust’s model prevents the following errors that manual memory management is prone to?
- Using an object that has already been freed.
- Failing to free an object that can no longer be accessed.
To me, preventing those problems is the main benefit of automatic memory management. C++ will happily let you make either one of these mistakes, and that’s how Rust is different.
I agree that Rust imposes a cost in the code to accomplish this compared to garbage collection. It’s up to the individual programmer to decide whether they think it is worth the benefits.
No comments yet.