Rust Ownership and Borrowing

  Рет қаралды 66,291

Doug Milford

Doug Milford

4 жыл бұрын

An in-depth discussion about Rust Ownership and Borrowing, including memory management concepts.
This Rust programming language tutorial series is aimed at easing your training step by step. Rust is a systems level language aimed at speed and safety and can be run cross-platform, including embedded systems and even the browser with WebAssembly (WASM)! I use the VS Code development environment to help you learn the core topics. Please join me on this journey with this fantastic new programming language.
Topics include coding basics, hello world, primitives, cargo, toml, rustup, arrays, borrowing, shadowing, string vs str, tuples, enumerations (enums), println and so much more...all free on youtube!

Пікірлер: 262
@sumechans
@sumechans 4 жыл бұрын
Not sure why I bought all these tutorials from Udemy, Packt etc, when this amazing tutorial was there free for everyone. Kudos to Doug. You are an amazing instructor.
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Thanks! Just wish you could have saved a few bucks. Oh well.
@sumechans
@sumechans 4 жыл бұрын
@@dougmilford7814 You mentioned on this video, tutorials on arrays, vectors and collections are coming, are they out?
@dougmilford7814
@dougmilford7814 4 жыл бұрын
@@sumechans Sorry... haven't gotten to it yet. Life gets in the way sometimes.
@sumechans
@sumechans 4 жыл бұрын
@@dougmilford7814 Definitely worth waiting. Thanks!
@canardeur8390
@canardeur8390 3 жыл бұрын
@@dougmilford7814 Timing: sometimes, when we want to start something, the great product for free is not there yet and we have no idea that this great product would come a couple of weeks later. Since we do not have the patience, we pay for courses. And yes: awesome tutorial and great job. Thanks to you, I now understand why we use references and not the objects themselves.
@yanchaoli551
@yanchaoli551 4 жыл бұрын
best rust tutorial ever, looking forward more stuff coming
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Wow, quite the compliment! I'm finishing up Rust 3D Graphics in the Browser right now. Hopefully by the end of the year it'll be out. I needed a break from the bread-and-butter topics to do something a little more fun. After that I'll circle back to some important fundamental topics like concurrency and creating macros. So, yes, more stuff is coming!
@anubhav200
@anubhav200 3 жыл бұрын
exactly
@nathanielwoodbury2692
@nathanielwoodbury2692 3 жыл бұрын
Holy crap it has never felt so simple. This dude is a teaching master haha
@danvilela
@danvilela 3 жыл бұрын
I am amazed with how can they build this kind of compiler
@hamzamohd.zubair1709
@hamzamohd.zubair1709 2 жыл бұрын
You have mastered Rust as well as the art of teaching
@amans6504
@amans6504 Жыл бұрын
oh my god, never seen this much clear explanation of programming in general. Wonderful
@kennethmarete5329
@kennethmarete5329 11 ай бұрын
This is the finest tutorial I have ever seen. It's well explained and illustrated with clear examples. Thank you Milford
@adehenry9591
@adehenry9591 11 ай бұрын
Best tutorials on rust ownership and borrowing i've seen so far....the humor made it easier too 😊
@estupefatos
@estupefatos 3 ай бұрын
He teached me Rust and also how to teach. Thank you, Mr. Milford. You're a legend.
@hamol3d
@hamol3d Жыл бұрын
One of the best Rust tutorial series I have come across. Thanks for sharing!!
@waynelee7320
@waynelee7320 3 жыл бұрын
I'm a JS programmer. I found this idea of ownership and borrowing is exactly what I need in JS. Copies and Refs are so messed up in JS. It is the best explanation on this topic I've seen and cleaned up a hell lot of mess for me to understand Rust. Thanks!
@zoidian601
@zoidian601 2 жыл бұрын
Ownership... what the ding dong is that?! But for real, great presentation. This was really clearly explained. Glad I found this channel
@leonidsdreams3919
@leonidsdreams3919 Жыл бұрын
This channel is underrated!
@dimitardimitrov3421
@dimitardimitrov3421 Жыл бұрын
This is by far the best Rust tutorial series I’ve ever watched! Excellent work!
@skylarwapato2535
@skylarwapato2535 2 жыл бұрын
"Nobody makes the first jump" love it
@yuong8139
@yuong8139 2 жыл бұрын
All these tutorials in rust are amazing. Your teaching is exceptionally engaging, clear and organized. You are an amazing and wonderful teacher . Thank you very much for teaching. Much appreciated.
@JitenPalaparthi
@JitenPalaparthi 9 ай бұрын
The best video on this topic
@local_lion
@local_lion 4 жыл бұрын
Great tutorial Doug, can't wait for the parallel programming guide!
@lukash7660
@lukash7660 Жыл бұрын
Wow! Lucky to run onto your tutorial, it makes a lot of sense compared to other Rust tutorials, great job! As a python/js developer with some knowledge of c/cpp I find that Rust combines both worlds in a unique way which somehow makes more sense than traditional concepts.
@auniquehandle
@auniquehandle Жыл бұрын
thank u ser, this is the best video on rust ownership and borrowing on the entire youtube
@OP-hw4xj
@OP-hw4xj 2 жыл бұрын
"If you cannot explain it simply enough, you do not understand it well enough", you sir most definitely understand the subject to the minute details! hats off to you for the amazing explanation!
@JDalmasca
@JDalmasca Жыл бұрын
Love the enthusiasm you bring to these videos! It's really reassuring to hear you explain things as a newcomer might experience it: "What the ding-dong is that??" -- me, in the future (probably)
@ClabirdDoudou
@ClabirdDoudou 3 жыл бұрын
Thank you very much ! The quality of all your Rust tutorials is amazing.
@mageprometheus
@mageprometheus 3 жыл бұрын
Perfect clarity of concept. Thank you.
@seanlacey
@seanlacey Жыл бұрын
Been working my way through the Book and have struggled with the ideas of ownership and borrowing. This video has really helped my understanding so thank you! I will definitely have to check out your others
@chucknorris7995
@chucknorris7995 11 ай бұрын
I finally understand this concept! thank you so much!!!!
@santerek28
@santerek28 3 жыл бұрын
really amazing ! kind of myth busting on Rust ! Thanks Doug !
@philipjin7572
@philipjin7572 3 жыл бұрын
Thanks Doug , a very good video to explain rust key function!
@maximodakila2873
@maximodakila2873 2 жыл бұрын
Where before I was hesitant to learn Rust because of it's high learning curve, now I am emboldened to learn it because you explain it so clearly. Thank you. Glad I stumbled upon your channel.
@ehsankhorasani_
@ehsankhorasani_ 2 жыл бұрын
These tutorials are like a GEM. Thank you very much
@invisiblian
@invisiblian 3 жыл бұрын
great tutorial. concise and to the point. many thanks
@zarrodd
@zarrodd 2 жыл бұрын
Thank you so much! very clear explanation.
@igorkuchin9302
@igorkuchin9302 3 жыл бұрын
Thank you very much! This makes ownership and borrowing quite clear.
@idiot7leon
@idiot7leon 3 жыл бұрын
Thanks! Very clear explanation, and fun lecturing! I enjoy it very much~
@wilstonoreo
@wilstonoreo 3 жыл бұрын
Awesome stuff, thanks so much Doug!
@mattforrest9010
@mattforrest9010 2 жыл бұрын
Really great tutorial, way more clear than anything else I've come across
@pheonex4180
@pheonex4180 3 жыл бұрын
Thank you so much for your Rust tutorials. They have been extremely valuable and definitely the best I've found.
@jpedrob
@jpedrob Жыл бұрын
Jupp. The best video on this. Thanks Doug!
@dkarlovi
@dkarlovi 3 жыл бұрын
Excellent explanation, it finally made it click for me! Thank you very much!
@abraham7966
@abraham7966 2 жыл бұрын
Very fine and well created material. Concise, straight to the point, and easy to understand. Well done, sir. Well done.
@niravprajapati1267
@niravprajapati1267 Жыл бұрын
Mind blowing 🤯! Thank you for video.
@Y3arin
@Y3arin 2 жыл бұрын
That was extremely helpful Doug, thanks!
@rogerthao588
@rogerthao588 2 жыл бұрын
This was such a helpful video. I feel like I actually understand ownership and borrowing in Rust now. Thanks Doug!
@lukekim825
@lukekim825 2 жыл бұрын
what a hidden gem. thank you so much for an amazing tutorial
@fbytgeek
@fbytgeek 3 жыл бұрын
Subscribed after watching just one video!! Content is of quality! Thanks a lot for your efforts! Please continue creating more content as time and circumstances permit.
@KontaJapan
@KontaJapan Жыл бұрын
I finally understand ownership and borrowing, thank you!
@irlshrek
@irlshrek Жыл бұрын
so good! cant wait to watch more of your Rust content!
@anuraghazra4772
@anuraghazra4772 3 жыл бұрын
Amazing video... very clear and concise. and loved the way you teach.
@sylver76
@sylver76 2 жыл бұрын
Thanks! This clears thing up a lot.
@amidfallen
@amidfallen Жыл бұрын
wow! After watchin this video, the stuff with ownership and borrowing seems pretty straightforward. Thanks!
@Barskest
@Barskest 4 жыл бұрын
You mention in the video that functional programming is the way to go. I've been trying to find information about it with moderate amounts of luck, could you possibly make an introductory video explainign some of the concepts with simple examples as you do with the topic of ownership in this video? :)
@KennethKasajian
@KennethKasajian Жыл бұрын
This is the type of thing that old-type C++ programmers used to do. Everyone was expected to know it, even high-level Application developers creating User Interfaces. The exception were the BASIC programmers, which is why VB became so popular
@peperudpeperudski1911
@peperudpeperudski1911 3 жыл бұрын
Best explanation I’ve heard. Can’t say I care much for the web assembly gymnastics at the moment, but I really hope to hear your take on threading, async io and other features that make a language “complete”.
@Victoria-jq9xz
@Victoria-jq9xz 2 жыл бұрын
great tutorial, you explain things very well!
@abhisheksinha9027
@abhisheksinha9027 3 жыл бұрын
I'll always be thankful to you 🙏
@HAL-9000-
@HAL-9000- 2 жыл бұрын
perfect explanation, thanks!
@indrajitbanerjee4350
@indrajitbanerjee4350 3 жыл бұрын
Wow rust's memory management is kind of revolutionary. It feels almost unbelievable that we came this far in programming languages and took us this long to figure out the fact that it is indeed possible to define rules of a language that doesn't permit most memory issues in the first place without a runtime garbage collection. Kind of makes the subject of garbage collector moot doesn't it? C++ does a good job despite being backward compatible with C. The only issue is C++'s solutions are library features mostly and can't come close to the rust's features that have much deeper ties with the language and the compiler
@dougmilford7814
@dougmilford7814 3 жыл бұрын
Yeah, Rust really re-thought the rules and came up with something groundbreaking. That took real courage.
@aminebioudi8414
@aminebioudi8414 2 жыл бұрын
Thank you Doug this was very helpful for me.
@RenaudDenis
@RenaudDenis Жыл бұрын
Great tutorial. That is easily the most troubling programming stuff I've learned in years but I think it's growing on me.
@ihasmax
@ihasmax Жыл бұрын
Fantastic explanation of a difficult topic in Rust. Thanks!
@sgwong513
@sgwong513 Жыл бұрын
so far this is the best and crystal clear explanation for rust ownership and borrowing video that I had watched. appreciate for the hard work.
@catarinapedreira3231
@catarinapedreira3231 3 жыл бұрын
Amazing video, thank you so much!
@joculator9820
@joculator9820 3 жыл бұрын
Great video sir - informative and enjoyable. Thanks
@sheikhakbar2067
@sheikhakbar2067 3 жыл бұрын
Best Rust tutorial on ownership! Watch it twice if you have to!
@marevsgodzilla
@marevsgodzilla 2 жыл бұрын
Great tutorial!!! Super helpful
@joaoguilhermejarochinskima1820
@joaoguilhermejarochinskima1820 3 жыл бұрын
A true hidden gem on youtube
@dougmilford7814
@dougmilford7814 3 жыл бұрын
Hey, thanks!
@paradoxfx
@paradoxfx 7 ай бұрын
Respect!!! And thank you for the best explanation on the subject
@nikoicardo9474
@nikoicardo9474 Жыл бұрын
Doug this is a great video. I like your sense of humor.
@nickssmirkingrevenge
@nickssmirkingrevenge 4 жыл бұрын
Great job! You explain everything so clearly and in a really engaging manner. Thank you!
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Glad you enjoyed it!
@williamb.2031
@williamb.2031 4 жыл бұрын
Awesome tutorial as always! Love how your commentary has a perfect mix of technical with a hint of goofy. Always makes them fun to watch. You briefly touched on functional programming, seeing some functional programming related tutorials in Rust would be fantastic :)
@dougmilford7814
@dougmilford7814 4 жыл бұрын
This is the second request I've had regarding functional programming I had in a week. I'll go ahead and move it up the list. Thanks for watching!
@WouterStudioHD
@WouterStudioHD 4 жыл бұрын
Rust is brilliant. I have quite some experience with C++ and I can totally see that Rust is just so much better. It's so explicit, consistent and well defined, while still being just as fast if not faster. I don't even know if I can bring up the motivation to write one more line of C++... Thank you for this clear explanation.
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Couldn't agree more!
@-taz-
@-taz- 3 жыл бұрын
Some languages are bringing back functional ideas that are older than computer science, even. Some try to clean up C++ like D and Go, or clean up Java like Kotlin. They usually remove or minimize inheritance, and maximize immutability. But Rust is the only one trying fundamentally new ideas. I've used C++ for 27 years, and I'm having a hard time with lifetime management in Rust -- the notations. Pattern matching is what lured me in, because I tried for years to do that well in C++, and I did alright, but then try getting some random C++ coworkers interested in algebraic types and overload sets. Good luck! I gave up. C++23 will probably get pattern matching, but lifetimes? Nope. Plus std::optional, std::any, and std::variant are a hodgepodge, and std::expected is still just a proposal.
@keeganspeck
@keeganspeck 3 жыл бұрын
I don't often comment on videos, but I've watched about a dozen today on the concept of ownership/borrowing/references in Rust and yours was *by far* (and I really mean *by far*) the clearest and most effective lesson I've seen on the topic. Kudos and thanks. Seriously.
@andermetalbrasil
@andermetalbrasil 3 жыл бұрын
Your videos are very well explained. I'm just a beginner hobbyist programmer trying to learn the Rust language, and your videos surely are a great help. My only experience with programming is a little of GDScript, the scripting language used in Godot game engine. I'm studying Rust for about only two weeks, reading the The Rust Language Book from the official website and watching some videos about the language, and I think I'm starting to understand how borrowing and ownership works, but I'll have to practice it a lot to make it natural to me. When I think I'm ready I'll try to make a game in Rust. Thanks for your work teaching this amazing language.
@i_dont_likevodka3062
@i_dont_likevodka3062 Жыл бұрын
Thank you for this amazing video
@TrevorSullivan
@TrevorSullivan 8 ай бұрын
This is an amazing video! Thanks for helping me understand memory management in Rust better. I'm working on my own video series on Rust, that's currently available on my channel, but I haven't covered borrowing and memory management yet. Keep up the great work, Doug!
@jmoz
@jmoz 5 ай бұрын
Fantastic video Doug and your style is quite funny.
@stphane
@stphane 3 жыл бұрын
Thank you for such a clear and exhaustive overview on Ownership and Borrowing concepts. Such free contents have no price and there should be as much "thank you" comments as there are thumbs-up on this video.
@rahulek914
@rahulek914 4 жыл бұрын
Very good coverage of seemingly difficult concepts. Your efforts are experienced through easy to understand samples. I suggest the topic of covering the standard library as much as you can. Thanks.
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Thanks :) I appreciate the feedback. I'm currently polishing up a mini-series on doing 3D Graphics in the browser with Rust, and it should be out in the next few days. I needed to tackle something fun, but I'll be able to get back to the bread-and-butter topics (including the standard library) by next week. There's so many topics I want to cover, and only so much time. It's motivating to get messages like yours, though.
@LinuxForLife
@LinuxForLife 3 жыл бұрын
The best video I have ever seen about this topic! Thank you.
@dougmilford7814
@dougmilford7814 3 жыл бұрын
Hey, thanks!... you're very welcome :)
@ManasTunga
@ManasTunga 3 жыл бұрын
Wow this tutorial was awesome !!!
@JamesColeUk
@JamesColeUk 4 жыл бұрын
This is a very clear explanation. Great job!
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Ah, thank!
@MaheshCRegmi
@MaheshCRegmi 3 жыл бұрын
So quality content! I thought this was a talk in conference!
@timvw01
@timvw01 2 жыл бұрын
This is great, and needs more views!
@willemvanderveen7567
@willemvanderveen7567 3 жыл бұрын
This is quality stuff man!
@myhendry
@myhendry 4 жыл бұрын
Gosh! Can i give 2 thumbs up?? Amazing video on Rust!!!! TQ very much Doug
@dougmilford7814
@dougmilford7814 4 жыл бұрын
I live for comments like these! I really appreciate it :)
@farhanyousaf5616
@farhanyousaf5616 3 жыл бұрын
Inspiring videos and fun!
@sippy_cups
@sippy_cups 4 жыл бұрын
this is such a FIRE tutorial! thank you so much
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Sure :)
@prueba875
@prueba875 Жыл бұрын
Great video! Thanks for sharing it
@dawid_dahl
@dawid_dahl Жыл бұрын
Awesome teaching! Subscribed. 🙂🙏🏻
@sudhir1274
@sudhir1274 4 жыл бұрын
Another very good tutorial. I was struggling to under this concept. Very well explained.
@dougmilford7814
@dougmilford7814 4 жыл бұрын
This video is my favorite as it really dives into the heart of Rust and it's idiosyncrasies. I'm so glad you and others have found it to be useful.
@nickschmitt8594
@nickschmitt8594 3 жыл бұрын
26:10 putting var_a.push('a'); after var_b and var_c.... awesome explanation!! thank you!!
@pshar2931
@pshar2931 4 жыл бұрын
Very helpful. Thanks for taking time to create such videos. I liked the way you represented the concept.
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Hey, thanks for the compliment! I appreciate it :)
@luhem7
@luhem7 4 жыл бұрын
Thanks for making this entertaining and informative to watch!
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Sure thing :)
@derekjohnson3189
@derekjohnson3189 3 жыл бұрын
This is so good!!!
@chiwbaka
@chiwbaka 2 жыл бұрын
This guy speaks directly into my brain. It's like learning in the Matrix.
@dougmilford7814
@dougmilford7814 2 жыл бұрын
I know kung fu
@omerozdemir1395
@omerozdemir1395 3 жыл бұрын
what the... you are explaining so well the ownership that it becomes easy as 2 + 2
@cerex1273
@cerex1273 4 жыл бұрын
I got the concept reading the official rust book but your clean explanation with examples is true gold. I'm sure you spent much time creating this tutorial with passion so you deserve all my gratitude for your hard work. Thanks so much :)
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Ah, thank you! Yeah, these videos are much more work intensive than they appear. This topic I spent quite some time trying to figure out how to describe it to others without confusing them more. I'm just so glad it seemed to come out well and the viewers are finding it so useful :)
@MrPetzold123
@MrPetzold123 4 жыл бұрын
Best explanation of ownership and borrowing I've seen, thanks ! I'm sure this will help when "negotiating" with borrow checker next time :-).
@dougmilford7814
@dougmilford7814 4 жыл бұрын
Hey, thanks! I'm glad it was helpful :)
3 жыл бұрын
Great tutorial. Thanks a lot!
@avatar098
@avatar098 3 жыл бұрын
Went on the journey to create a game entirely with Rust! Ran into your video and it totally helped me understand this!
@dougmilford7814
@dougmilford7814 3 жыл бұрын
Hey, great! I'm glad the video helped :)
Rust Lifetimes
26:52
Doug Milford
Рет қаралды 49 М.
Understanding Rust Closures aka. Anonymous Functions 🦀 💻
30:22
Trevor Sullivan
Рет қаралды 9 М.
Она Постояла За Себя! ❤️
00:25
Глеб Рандалайнен
Рет қаралды 6 МЛН
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 44 МЛН
Rust Structs, Traits and Impl
24:53
Doug Milford
Рет қаралды 33 М.
Rust Modules - Explained Like I'm 5
19:59
Let's Get Rusty
Рет қаралды 67 М.
Rust: Ownership and Borrowing
17:49
The Dev Method
Рет қаралды 2,3 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 273 М.
Rust for the impatient
10:43
No Boilerplate
Рет қаралды 639 М.
Rust Generics
22:10
Doug Milford
Рет қаралды 21 М.
Rust: What is Ownership and Borrowing?
19:42
Gary Explains
Рет қаралды 22 М.
Async Rust Is A Bad Language | Prime Reacts
28:46
ThePrimeTime
Рет қаралды 83 М.
Rust String vs str slices
14:58
Doug Milford
Рет қаралды 23 М.
Готовый миниПК от Intel (но от китайцев)
36:25
Ремонтяш
Рет қаралды 358 М.
Радиоприемник из фольги, стаканчика и светодиода с батарейкой?
1:00