Rust for Java Developers 3/3 - Understanding Ownership

preview_player
Показать описание
Rust Programming Tutorial for Java Developers, Understanding Ownership.

- 00:00 - Two Types
- 00:20 - Rust Memory Compiler Managed
- 01:10 - Ok - Foo Single Call
- 02:05 - Error - First Borrow Checker Error (ownership)
- 04:20 - Fix - Ownership with & ref
- 05:37 - Ok - Call twice
- 06:45 - Error - Mutable
- 07:15 - Fix - &mut
- 07:35 - Error - Multiple Mutable References
- 11:07 - Ownership & Data Integrity Matrix
- 11:54 - Ownership Matrix by example
- 14:43 - Conclusion

== Related videos:

== Related Playlists:

Other popular Rust Programming videos:

Playlists:

Рекомендации по теме
Комментарии
Автор

I'm surprised this hasn't got more views. This series is a wonderfull starting of point for people wanting to learn Rust.Thank you for the videos!

computerfan
Автор

I started learning Rust to replace my backend in Apollo Nodejs, I was terrified when I saw that the video 2/3 was the last one. 1 days later you upload it. thanks!

arthurfiorette
Автор

Have to get up to speed with Rust, wicked Tutorials. Thanks a bunch, will be buying you a coffee. Cheers

SquifiMcDougall
Автор

Exactly what I was looking for. Would love to see more on OOP concepts in Rust (Rustbook chapter 17)

realdeal
Автор

That is such a good explanation. Thank you very much!

shoockygaming
Автор

Loving the format and pace. This will be my go-to introduction video series to recommend to my colleagues!

mangefox
Автор

Thank you for this series! I've just watched the other two parts and was surprised that this one came out just now (because references and mutability were the ones I struggelt the most with while trying to learn rust before)

xelantro
Автор

One of the best videos on rust ownership concepts. Great work!

kuldeepgupta
Автор

I love it I'm a java dev also many other lang including rust is great

noname_hacke_
Автор

Keep up the good work, really like your side by side comparison format :)

ThanhNguyen-iost
Автор

Excellent explanation. That way I can understand it.

tmsngr
Автор

Thank you for these videos~~ Great helps for me to start !

xiaocheri
Автор

This was a great video, appreciate you posting it. One aspect I’m still learning more about is the why/how?

It seems like explicit ownership passing is helpful so that users at the call site aren’t surprised by having the value of variables change out from under them after a function call.

I’m curious if the single mutable ref restriction is for the same reason. What does this limitation on the rust side protect you from, that Java wouldn’t? My guess is that again at the call site, you’re expectations about the “stability” of a value is satisfied bc once you borrow a mutable ref, you can assume no other code will change out the value from underneath you until you dispose of the ref.

PRonYouTube
Автор

I've used Rust for years, but was curious about how you would use the comparison with Java to explain ownership. I think it does help to anchor the topic in familiar Java code, so good job!

In theory IDEs could colorize data identifiers differently depending on whether they are owners, mutable borrows, or immutable borrows. I wonder whether that would help people keep things straight, particularly early on.

ClearerThanMud
Автор

I liked the &mut Foo versus &Foo while passing variables to functions. Passing immutable struct reference makes it easy to reason about the behavior of the program. I wonder why pass-by-reference is not the default, as that would have made programming in Rust simpler.

SourabhBhat
Автор

I added a comment with a question but it somehow is disappearing. Perhaps because I included a link? I like this video. However, I do not understand why it works for a struct (Foo) but if you were to change it to use a simple scalar variable (x), it doesn't. I think it may have to do with heap vs stack but it's my understanding that everything is on the stack by default. Thoughts?

rlrl
welcome to shbcf.ru