Understanding Ownership in Rust

preview_player
Показать описание
The ultimate Rust lang tutorial. Follow along as we go through the Rust lang book chapter by chapter.

0:00 Intro
0:40 Ownership Model
4:30 Stack & Heap
6:53 Ownership Rules
7:21 Variable Scope
8:22 Memory & Allocation
10:32 Ownership & Functions
12:23 References & Borrowing
18:34 The Slice Type
24:56 Outro

#letsgetrusty​ #rust​lang #tutorial
Рекомендации по теме
Комментарии
Автор

You're an incredible teacher, so much clarity.

nathanielwoodbury
Автор

As a line-of-business developer I've been a bit intimidated about learning an innovative system language like Rust - but this makes one of the gnarliest features seem learnable. You're a good teacher.

tullochgorum
Автор

Finally, found someone that covers the rust guide book. Thanks, man. Super time saver

desrucca
Автор

I am going to watch this every day until I understand it in my bones

eileennoonan
Автор

I don’t know why, but the borrow checker doesn’t confuse me that much. Use a reference when you want to see the original memory through a window, move when you want the data for yourself, and never have a window to a place that does not exist.

enderger
Автор

This is by far the best explanation about Rust's borrow mechanism I've encountered so far! The course is an excellent resource for Rust newcomers. Great work!

giovannimazzocco
Автор

10:53 "When we pass in parameters into a function its the same as if we were to assign s into another variable" - now that's when the borrow checker finally clicked for me. Now I also understand why it's so controversial to some people. Your tutorial so clear and easy to understand. Thank you!

Haitaish
Автор

So I recently just made my first foray into Rust by attempting to build a calculator in a Yew app. I am still struggling with the logic itself, but I actually found the battle with the borrow checker to be one of the more refreshing sorts of problems I ran into. It made me think so much harder about where I was declaring my variables and where I was mutating them that it kinda just felt like my brain was steadily increasing in mass and wrinkle count the whole time.

andythedishwasher
Автор

im amazed at how much the rust-analyzer and compiler are teaching me without even running code. You're explanation makes it a top-grade experience

jesusmtz
Автор

I think that was the best explanation I've come across so far...you took the time a noobie would need to learn this stuff, and didn't try to "keep under two minutes" destroying the clarity for the sake of speed. Also, you didn't jump immediately to metaphors of "oh, its like if you have a book, and you lend it to someone, but that person can write on the book" and so on...I also find those unnecessary and confusing sometimes

SKyrim
Автор

This is really fantastic! Your cadence, examples and explanations are really great! I've been programming for 25 years (C++, C#, Js, etc etc) and this is a really nice way to understand nuances of rust. Thank you!

aaronkingcto
Автор

7:57 - why would you have to use new to allocate memory on the heap in C++? Just use std::string s("hello"), or std::vector<char> and it works just like it did since 30 something years, memory is deallocated at the end of scope.

teenspirit
Автор

I think this is the best video on YouTube to explain the ownership model. Great Work.

eslamelsharkawy
Автор

I am new to Rust, read ownership chapter twice, got the concepts of ownership, reference and moves but still wasn't confident. This video did the trick and made everything crystal clear. Thanks a ton!

Deepz
Автор

First tutorial series on Youtube where I don't even hesitate for a second before clicking the thumbs up button. Great job!

TheKisem
Автор

Very nice series
As a hobbyist who's dabbled in a bunch of languages because it's fun, i'm now learning me some rust.
Certainly doing my share of fighting with the borrow checker but that said, i'm super impressed with the errors and warnings that the compiler spits out.
Most helpful messages that i've encountered in any language; have helped me sort out a bunch of things which in other languages i would have had to fire up the google to work out what was going on.

samdavepollard
Автор

I was worried learning Rust, but more I look at this. THIS MAKES SO MUCH SENSE!

kmaximoff
Автор

Video form of the book helps me so much, I read really slow, you covered the entire chapter in 25 min shorter than I could probably read it lol.

brennancurrier
Автор

I read the rust book ownership chapter but was confused. Your video makes the concept much clearer. Thanks and keep it up!

yichizhang
Автор

I read the book and i was overwhelmed of new terms and information. this video helped me to visualize it live. yes rust book visualizations were great but for me i find this more helpful. i think after watching this, i will understand the book better. thank you.
there are too little learning resources for rust :)

almuaz