Summary
With Rust, we have seen that there are some traps when coming from a dynamic programming language background. However, with a little bit of knowledge of referencing and basic memory management, we can avoid common pitfalls and write safe, performant code quickly that can handle errors.
In this chapter we also covered the concepts of borrowing and referencing in Rust. While adhering to borrowing rules requires more effort than coding in a garbage collected language, we have a deeper understanding of how variables are placed in memory. This deeper understanding is safer as we know exactly what data we are pointing to. For instance, if we were using a language like Python and we created an instance of an object when we then passed into two dictionaries (python's version of a hash map), then if we updated one instance, the other would also be updated because it is a shared reference to the same memory address, the developer however may never know. In Rust, the borrow checking...