Hopefully you "understand" rust now
The selling point of rust should become more clear now. Why people love it.
Option
, Result
, and Iterator
s are a foundation of the items you work with
and allow for highly optimized code with great readability
But there is one more concept that we need to go over. The Borrow Checker. This is the item that everyone always talks about when it comes to Rust and difficulty. I would argue its not that difficult. What you just got done learning is more difficult.
But first
These next parts are teaching you some of the rust fundamentals that just don't have a typescript side by side. To be able to use rust effectively, we need to cover these
Stack vs Heap?
You have probably heard this term throughout your career. It may confuse you what they are. To understand rust, it is required you have a very simple understanding of the stack
- first stack overflow
- struct
- struct with Vec
- storing struct in Vec
- storing struct with Vec in Vec
- (whiteboard everything)
- now talk about Option
for every heap allocation there is a stack allocation
Questions?
Do you have questions about this?