Did you like how we did? Rate your experience!

4.5

satisfied

46 votes

To what extent can Rust's approach to memory management make life?

I can't remember the last time I needed to explicitly allocate and deallocate memory, and I've been writing C++ for the last 8 years. With scoped pointers and RAII, you hardly think about memory management anymore. Now, there's still some caveats you need to know about to avoid getting dangling pointers in your code. For example, a process as simple as pushing back elements to the end of a vector may cause reallocation of the whole vector, invalidating all your iterators in the process, but after a few times falling for this trap, you start getting the hang of it. I don't consider memory management my biggest issue with C++. I do consider the lack of modern and reliable C++ libraries to be the main obstacle to further adoption. Companies who decide to use C++ usually have to write a lot of infrastructure code before they can focus on their primary product.

100%
Loading, please wait...