Это видео недоступно.
Сожалеем об этом.

Learning Rust: Memory, Ownership and Borrowing

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024

Комментарии • 139

  • @taylorallred6208
    @taylorallred6208 5 лет назад +97

    That was one of the greatest analogies for teaching scope I have ever seen. Also, thank you for helping me understand rust's ownership!

    • @YouCodeThings
      @YouCodeThings  5 лет назад +1

      Cheers! Glad the video was useful :)

    • @brianhechinger8715
      @brianhechinger8715 Год назад

      I'm only finding this video three years later but I just have to echo this. I've always struggled explaining stack/heap to people and this analogy makes it so super simple. I'm totally stealing this. 😀

  • @YouCodeThings
    @YouCodeThings  6 лет назад +76

    You're an amazing person!

    • @ichdich2332
      @ichdich2332 5 лет назад

      Thank you, dito.

    • @Debianz
      @Debianz 5 лет назад +5

      I can see you haven't made any videos in a while. Please don't give up, your doing great. I know RUclips channel growth can be slow, but you will get there at some point. Love the videos, keep up the great work.

    • @mikailkhan9166
      @mikailkhan9166 5 лет назад +1

      no u

    • @HermanWillems
      @HermanWillems 4 года назад +1

      Did you just comment this to your own video? :) haha you must feel amazing about your own personality :D

  • @itsr4yd946
    @itsr4yd946 4 года назад +41

    This channel deserves A LOT more subscribers!

  • @TBaguette
    @TBaguette 4 года назад +7

    Please continue making videos, you're clearly one of the funniest and best channels about programming ever ! I'd even say that if one day Rust becomes more popular, your channel could become very successful ! I really enjoy your Rust videos, I hope more are coming soon.

  • @rifaldhiaw
    @rifaldhiaw 3 года назад +1

    This is the best borrow system explanation yet!

  • @officialabdulrehman
    @officialabdulrehman Год назад +1

    What a gem of a channel 💎

  • @albert21994
    @albert21994 5 лет назад +5

    this is the best programming channel I have discorvered! subbed.

  • @verified_tinker1818
    @verified_tinker1818 2 года назад +2

    One of the best programming tutorials I've ever seen. Thanks!

  • @interceptings8624
    @interceptings8624 Год назад

    ACTUALLY SUCH A GOOD VIDEO i like the animations and explanations just makes it that much easier from going from something i know to jibberish code

  • @wutong4524
    @wutong4524 2 года назад +1

    Holly crap, this video is golden

  • @NoorquackerInd
    @NoorquackerInd 3 года назад +1

    Every RUclips video about Rust is always at least half an hour long and I've put off learning just because of that, but finally I've found something good

  • @simonwtong
    @simonwtong 5 лет назад +2

    I just finished reading the Ownership chapter of the book and this further solidified and clarified the lessons, thank you!

  • @kaderramy4021
    @kaderramy4021 5 лет назад +3

    mind blow. of how easy you make complicated rusty concepts look. keep rocking dude

  • @sashalarious5990
    @sashalarious5990 4 месяца назад

    Really enjoying the color scheme of this channel ☺️

  • @nhefner
    @nhefner Год назад +1

    I just started with Rust and this video was super helpful! Keep up the excellent work, you deserve way more subs!

  • @flash_alexander
    @flash_alexander 4 года назад +6

    I wish to have similar videos covering the entirety of rust? your videos are vivid and make it easy to understand Rust for a programmer

  • @Arunscape
    @Arunscape 5 лет назад +3

    This is the best way I've seen ownership being explained. Thank you!

  • @jackwright517
    @jackwright517 7 месяцев назад

    WHOA! This is super clear and well explained. 🤯

  • @tetuaoro
    @tetuaoro 3 года назад +1

    Ownership animation amazing thx fully

  • @anshvashisht8519
    @anshvashisht8519 Год назад

    that a wonderful explanation, so much time invested in making the difficult concept clear by animation.

  • @DeriveIt
    @DeriveIt 3 месяца назад

    This video is great. Love the call stack analogy.

  • @avimehenwal
    @avimehenwal 4 года назад +1

    I am having so much fun learning #Rust. Thankyou you guys @YouCodeThings, these videos makes it so effortless. Thats the power of community

  • @jithind-feverx2818
    @jithind-feverx2818 2 года назад

    Ownership explained clearly ❤️❤️

  • @lancecarter8732
    @lancecarter8732 2 года назад

    Was just reading chp.4 in the Rust book and this really helped

  • @soupnoodles
    @soupnoodles 2 года назад +1

    Really loved this video, especially the out-of-scope lesson
    Really didn't get into my head just by reading the book, this was super useful!

  • @nathanielgraham958
    @nathanielgraham958 4 года назад

    I came across your video while trying to figure out why I got errors no matter where I tried to put an '&'. At the end of the video, I looked at my code, went "huh," and typed a single '&' next to one of my variable calls. Immediately every red squiggly line disappeared. Thank you! You explained ownership in an extremely helpful way.

  • @adinesh7989
    @adinesh7989 6 лет назад +19

    Great video. Too much work into each video. I like it.

    • @YouCodeThings
      @YouCodeThings  6 лет назад +5

      Thank you! I got way too into those animations in this video!

  • @fahmi2978
    @fahmi2978 5 лет назад +1

    The Friendly way to Learn Rust , and i love it . Thanks mate

  • @rajanpoudel3787
    @rajanpoudel3787 6 лет назад +2

    subscribing to your channel is the best thing that happen to me. loved your tutorials.

    • @YouCodeThings
      @YouCodeThings  6 лет назад +1

      Thanks for leaving a comment and subscribing!!! :) Your comment is the best thing that's happened to me.

  • @Tr3Gee
    @Tr3Gee 5 лет назад +3

    Thanks for such a clear explanation. The animations really helped, lol. Thank you YouCodeThings

  • @joelmontesdeoca6572
    @joelmontesdeoca6572 2 года назад

    This explanation was amazing!

  • @janniswildermuth1499
    @janniswildermuth1499 Месяц назад

    Really great explanation, thank you!

  • @ragrazila
    @ragrazila 4 года назад

    this channel deserves many more subscribers.

  • @oroneki
    @oroneki 5 лет назад +1

    Oh! (...) my! (...) God! That is gooold! Thanks so much! Cheers from Brazil!

  • @borys4206
    @borys4206 2 года назад

    I like your videos and its style! Thanks!

  • @hagenlens1403
    @hagenlens1403 4 года назад +1

    This video is so fucking great.

  • @ktlknss
    @ktlknss Год назад

    thanks so much, I was wondering why the & was used sometimes but now I get it!

  • @GlebEagle
    @GlebEagle Год назад

    Wow, this explanation is awesome!)🦀❤

  • @ysuv5563
    @ysuv5563 6 месяцев назад

    I had to laugh so hard after seeing the angry face at 2:00
    I have very little sleep, but this made me laugh hard. Thank you for making me laugh and thank you for the explanation.

  • @LakshmipathiG
    @LakshmipathiG 4 года назад

    Great thanks! Excellent stuff.

  • @ailuros_
    @ailuros_ 5 лет назад +1

    Nice style making video. Very fun!

  • @penta5421
    @penta5421 4 года назад

    Damn, didn't understand this up until now. After watching the video, it kind of clicked and I actually understood! Thanks :D

  • @1337CodeMaster
    @1337CodeMaster 2 года назад

    Very well explained! Thank you so much :D

  • @docentealejandrocarrillo471
    @docentealejandrocarrillo471 4 года назад

    This video is more explained than the Rust Book.

  • @shibasispatel6624
    @shibasispatel6624 4 года назад

    You are a great teacher. Glad I found your channel..

  • @mateuszgrzonka3826
    @mateuszgrzonka3826 4 года назад

    Love your vids!

  • @ruis2345
    @ruis2345 4 года назад

    Well explained, hats off

  • @arcticspacefox864
    @arcticspacefox864 4 года назад

    I love your video😂 it was great and interesting! Please continue your style

  • @xbony2
    @xbony2 3 года назад

    This is hella professional, great work.

  • @DwarkeshPatel
    @DwarkeshPatel 4 года назад

    This is such great content. Thank you!

  • @niravprajapati1267
    @niravprajapati1267 2 года назад +1

    Good work :)

  • @EngineerNick
    @EngineerNick 3 года назад

    Thankyou for this clear explanation :)

  • @elimgarak3597
    @elimgarak3597 3 года назад

    Great video! Thank you so much!

  • @kenny-kvibe
    @kenny-kvibe 3 года назад

    Good descriptive video, simple and concise, thank you!

  • @harrimahlstrom7706
    @harrimahlstrom7706 4 года назад

    Realy good explanation!!!

  • @vedantnn7
    @vedantnn7 2 года назад

    you really teach in very nice manner, instant subscribe

  • @quangle5701
    @quangle5701 3 года назад

    Excellent explanation ! Thank you very much.

  • @KarimAlbakry
    @KarimAlbakry 5 лет назад +6

    you forgot to mention that this only for reference types not value types

  • @phildevtv409
    @phildevtv409 2 года назад

    Thx for great explanation!

  • @guillaumebogard5880
    @guillaumebogard5880 5 лет назад

    Your channel is amazing ! Keep up the good work :)

  • @Nate-gi7no
    @Nate-gi7no 3 года назад

    SICK VIDEO!

  • @doyourealise
    @doyourealise 5 лет назад

    the best video on ownership amaizng

  • @WizardOfArc
    @WizardOfArc 5 лет назад +1

    These are entertaining and informative - thank you

  • @fabiomarsiaj8172
    @fabiomarsiaj8172 4 года назад

    Dude your videos are super good, keep going and thank you :)

  • @tengkuizdihar
    @tengkuizdihar 5 лет назад

    Wow this is well explained and really consice and clear. Very good job.

  • @blue_lobster_
    @blue_lobster_ 5 лет назад +1

    Super cool video! Subscribed!

  • @thengakola6217
    @thengakola6217 3 года назад

    No, ur an amazing person *inserts keanu.jpg*

  • @TheOMGPoPCorn
    @TheOMGPoPCorn 5 лет назад

    Just what I needed. Great job!

  • @henrytan5707
    @henrytan5707 4 года назад

    Love it.

  • @orochi639
    @orochi639 11 месяцев назад

    Good explanation

  • @AbhishekNigam
    @AbhishekNigam 5 лет назад

    Explained really well!

  • @michelkazi3112
    @michelkazi3112 4 года назад

    Holy shit. I understood this.

  • @YummyRed
    @YummyRed 4 года назад

    Maaan, you should make more learning videos. It's damn funny and useful.

  • @kcru240
    @kcru240 4 года назад

    I feel you sound like Dr. Seuss: there is a nice rhythm to the way you talk.

  • @veggiefoodadventure
    @veggiefoodadventure 3 года назад

    nice explanation, thank you :)

  • @wishnuprathikantam
    @wishnuprathikantam 4 года назад

    Hey @youcodethings Great content 👍, please do more videos , if possible regularly!

  • @renatajakubowicz9664
    @renatajakubowicz9664 6 лет назад

    Thanks for teaching Rust!

  • @gbrls_yt
    @gbrls_yt 5 лет назад

    Hey man! good job, keep it up

  • @ladyViviaen
    @ladyViviaen 3 года назад

    i FINALLY learned pointers

  • @user-bl9ec8kj3w
    @user-bl9ec8kj3w 16 дней назад

    I like how this dude pronounce data as "d a t a"

  • @paroxyzm21
    @paroxyzm21 11 месяцев назад

    What about tuples? Those also should have fixed size, so should be stored on the stack? BTW. Thank you for a great video!

  • @YouCodeThings
    @YouCodeThings  6 лет назад +34

    Tell me, what can I do to become the best coding channel for you?

    • @wildtiger670
      @wildtiger670 6 лет назад +26

      Give us more! :D

    • @natecoley160
      @natecoley160 6 лет назад +3

      give us examples of that is rust was created for - safe async/parallel programming.

    • @ubermons
      @ubermons 5 лет назад +3

      Make a playlist of this!

    • @aeroball8360
      @aeroball8360 5 лет назад +2

      my only suggestion is slower pace. Watching your videos on normal speed is like watching other coding videos at x2 speed. If someone wants it faster they can always up the speed at normal quality, but trying to down the speed to 0.75 is weird and sounds choppy thanks to however youtube is encoding the speed change.

    • @ailuros_
      @ailuros_ 5 лет назад

      You have done an amazing job so far. I wish your videos had subtitles but I know it's so hard. Maybe speaking a little bit slower it's a tip too, since I am not a native english speaker. That said, this channel is great! Keep it up!

  • @geeksesi
    @geeksesi 4 года назад

    amazing. thank you.

  • @cd-stephen
    @cd-stephen Год назад

    good vid ty - new sub

  • @andersmusikka
    @andersmusikka 4 года назад

    What microphone do you use? You have spectacularly good audio quality.

  • @kangalio
    @kangalio 6 лет назад +1

    Thank you! ^.^

  • @bharathhariharan4750
    @bharathhariharan4750 3 года назад +1

    Why aren't you making new videos...your videos are great.

    • @YouCodeThings
      @YouCodeThings  3 года назад

      Appreciate it! A lot going on. Currently working on some larger game projects. Want to eventually make some videos on that process.

  • @davidgromer2117
    @davidgromer2117 3 года назад

    Hi,
    at 4:11 you made an example which does not allow a copy of x to a because of rule 2. So far I understand this. Could you please explain why a copy would be ok if we would assign the following:
    let x = "Hello World";
    let a = x;
    println!("{},{}", a, b);
    So there must be a difference between let x = "Hello World" and let x = String::from("Hello World").
    I heared something about string literal and string type but I do no really get the difference.
    Is "Hello World" stored at the stack?
    Thanks

  • @henkroth
    @henkroth 3 года назад

    I really got alot from this. My ADHD needs to be spoonfed stuff sometimes :P

  • @marusdod3685
    @marusdod3685 4 года назад

    ive never programmed in rust before, but why shouldnt we be able to have two pointers pointing to the same address? Like if I just wanted to iterate over an array or linkedlist I would probably need many variables pointing to the same location

  • @king_james_official
    @king_james_official Год назад

    7:18 wouldn't &a[0..2] return hel? same for the second one, it's one letter too long

  • @codewithnws3544
    @codewithnws3544 7 месяцев назад

    Hey can you share the idea of creating this video like in the 2d drawing with the animation, what softwaresthat you had used?

  • @aiomixrecords
    @aiomixrecords 6 лет назад +1

    You are great, what do you think is the best way to represent a Cyclic Graph with multiedges in-memory store and enable parallel reads/writes concurrently to the graph? .. am coming from erlang/elixir world where the shared memory is a sin, but I could use ets(memory erlang term storage) and let the genservers/processors(independent heap) get copies from the ets , now my question, how borrowing feature is diffrenent? Is the data is copy as well like elixir? Do you recommend me to move to rust instead of elixir ? Is it possible to have more parallelism in rust more than elixir? I think parallelism algorithm highly depend on shared memory approach? Elixir and rust seem they share a lot, thank you for this amazing work

    • @YouCodeThings
      @YouCodeThings  6 лет назад +2

      I love Elixir as well! They solve different problems. If you need something really fast where you can have a very good understanding of the nuts and bolts, I'd choose Rust.
      Elixir has a larger ecosystem (due to the Erlang ecosystem interop as well) and feels quicker to build distributed systems in.
      The real question is, why not both?
      There's a library called `Rustler` that lets you call Rust from elixir. This might be useful if you have a small piece you need to make performant.
      Finally check out this conference talk. It's an actor library written in Rust, and demonstrates some incredible features.
      "Type Safe & High Perf distributed actor systems with Rust" - ruclips.net/video/qr9GTTST_Dk/видео.html
      Thanks for the comment! =D

    • @aiomixrecords
      @aiomixrecords 6 лет назад +2

      Thank you a lot for your quick response, i actually was thinking of enabling both to work together where rust work as engine for the graph and receive requests from genservers(elixir)(handling concurrent connections) this way I will take the best from the two languages. thanks again for this amazing content, pls keep up the good work. All the best, am going to watch the link ;)

  • @laviray5447
    @laviray5447 2 года назад

    4:42 when the variable X becomes invalid, what exactly then it equals to? what will be the value of X when it comes invalid?

    • @wutong4524
      @wutong4524 2 года назад +1

      When it becomes invalid, its value is still "hello", but isn't anymore after it became invalid. If you try to access it, it will throw an error (The compiler will throw an error because it's intelligent).

  • @lionelprestes
    @lionelprestes 2 года назад

    make more rust tutorials plzzzzzzzzzzzzzzzz

  • @Pluvo2for1
    @Pluvo2for1 Год назад

    Is the idea of the heap the same as c++? That is, the heap is extra memory the program requests from the OS while the program is running?

  • @laughingvampire7555
    @laughingvampire7555 Год назад

    ok, I prefer Haskell lazyness is less of a mess

  • @JoshuaKisb
    @JoshuaKisb 5 лет назад

    hey this looks like the programming language i was thinking of one day making. except i dont understand why they changed the syntax, whats with all that ! ! stuff and why does it become read only when borrowed. i dont get that

  • @Jack_in_the
    @Jack_in_the 2 года назад

    our usernames are basically the same

  • @ajinkyax
    @ajinkyax 4 года назад

    I watched the video 2 times. And it s all clear now. Very fun to watch and good info. Thanks. There is still a confusing things for me like just a * and &* and