Benefits
- Improved memory management
- Compiled (Like C/C++, faster performance)
- This makes it faster than most languages
- No pointers or nulls (unlike C, Java)
- Strict Typing.
- Makes code harder to compile but less bugs at runtime
- Refactoring/Modifying existing code is a lot less risky.
- Once your code compiles, you can be very confident that it won't have bugs.
- Compiler is more helpful compared to most languages. Will show the error and suggest resolutions.
- No garbage collection
- Strict Typing
- Have to typedef every variable.
Exception Handling
- Rust has no exceptions.
- Instead, returns an object Result<T,E> with either a recoverable or nonrecoverable error.
- If it's nonrecoverable, you have to deal with it at compile time up front, before it affects the app.
Ownership
- Biggest new concept in Rust
- When you use a variable and assign it to another, it's "used" and the memory is released.
- y = a + b, a and b are released
- Guarantees low memory usage.