Use the Rust Vec Type for Dynamically Expanding Arrays 🦀

Поділитися
Вставка
  • Опубліковано 28 вер 2024

КОМЕНТАРІ • 20

  • @TrevorSullivan
    @TrevorSullivan  Рік тому +1

    Check out the full Rust playlist for more Rust programming videos! 🦀 ➡➡➡➡ ua-cam.com/play/PLDbRgZ0OOEpUkWDGqp91ODn0dk7LPBAUL.html

  • @mssafy2592
    @mssafy2592 4 місяці тому

    man , thank you so much 🥺✨

  • @Hellbending
    @Hellbending 8 місяців тому

    I really love your videos because you go into a reasonable amount of detail with what’s happening and I just had a couple questions about these videos, and I guess like… ‘who these videos are really aimed at’ which might sound a little strange but there’s a couple of things that you do that don’t quite make sense to me given the videos are aimed at very early learning.
    They are obviously aimed at beginners and potentially even people brand-new to programming as a whole and often times you do some things that seem rather counterintuitive to general good programming practice, but I’m not understanding why you do them, i’m only at 13:30 of this particular video but I’ve seen it happen in a couple of your other videos where you prefer to duplicate code over using something that’s already there (and you don’t go back to use it/change it for further examples etc. so it doesn’t serve a real purpose of duplicating it) and by this point in the video you create a second loop of 0 to 100 when we already have a loop that exists.
    The other major thing there’s things that come up like using swap_remove instead of remove in the tooltip that mentions if you’re removing an item from the first index (which we’re doing here in the example) to not use removed because it has to shift everything within the Vec - and says it’s is incredibly bad when it comes to performance. I think acknowledging the tooltip for the general/beginner viewers or even just giving a bit of a nod towards those kind of things when they pop up just to help newbies understand it exists and there’s very much reasons to not use specific methods etc. Sort of like, they need to learn the remove method, but it might not be perfect in a situation like this, where we’re operating on the very first index (or in even larger Vec or array)
    I’m not meaning to bring this to you as like a point of contention or anything wrong I just think it might be that extra little bit that might really put you in a couple peoples recommendation spotlight of getting friends to come watch your content ya know, things like that.
    Much love brother ❤

    • @TrevorSullivan
      @TrevorSullivan  8 місяців тому +2

      Hey Blake, thank you for sharing all your thoughts in so much detail! I am still learning this language, and I'm just sharing knowledge as I progressively learn it. That's probably why you see me occasionally miss helper methods, that make life a little bit easier than the way I do it (ie. swap_remove).
      I'm not entirely sure, but I *think* the reason that you see me duplicating code, is to section it off so that it's still a working example. If someone is following along, and I modify the code that we talked about over the last couple of minutes, they might lose perspective. Does that make sense? In more recent videos, I know that I have started sectioning code off into separate functions and structs. That helps keep things more organized as we progressively add new topics to the discussion.
      I appreciate your support! I'm still learning Rust today, however I've been posting on my company's blog and UA-cam channel. You can check it out at stratusgrid.com/blog
      God bless you! ❤️ Rust on! 🦀

  • @subhamprasad1373
    @subhamprasad1373 9 місяців тому +1

    Make video on macros....in depth video

  • @hsthast7183
    @hsthast7183 Рік тому +3

    Really enjoying the series. keep it up 👍

  • @pipi_delina
    @pipi_delina Рік тому

    How does one do test in rust. Do you have plans for such? Like TDD Rust

    • @TrevorSullivan
      @TrevorSullivan  Рік тому

      Another great question! Yes, I'll get to Rust testing eventually! I'm trying to start with the language fundamentals, using as few dependencies as possible, but using the built-in test annotations. doc.rust-lang.org/book/ch11-01-writing-tests.html

  • @maguilecutty
    @maguilecutty 9 місяців тому +1

    How does this guy have such little traction? He’s the best if ur a beginner/intermediate like me!!

  • @MH-bw9lh
    @MH-bw9lh Рік тому +2

    Feel like every day to have a lesson, very nice.

  • @pipi_delina
    @pipi_delina Рік тому +2

    This course is very informative. can you build an API with it in a simple project with auth and postgres db.

    • @TrevorSullivan
      @TrevorSullivan  Рік тому +3

      For sure! I will get to some app creation after we cover most of the Rust fundamentals! Great idea! 💡 Rust on!! 🦀 Thank you for your kind comment!

  • @restauradorcaseiro
    @restauradorcaseiro 3 місяці тому

    A playlist about the stabby macro = ❤❤

  • @veskopetrovic4970
    @veskopetrovic4970 Місяць тому

    Very nice. Thx.

  • @sdlfljdfkl
    @sdlfljdfkl 7 місяців тому +1

    In 36:30, it should be possible to just have |e: &Car| e.manufacturer == "Porsche", that is already the sought boolean!

    • @TrevorSullivan
      @TrevorSullivan  7 місяців тому +1

      That's a lot cleaner! Thanks for sharing.

  • @ERAYKAAN850
    @ERAYKAAN850 Рік тому +1

    nice video!

    • @TrevorSullivan
      @TrevorSullivan  Рік тому +2

      Thank you! ♥️ I have more coming. One is processing now.

  • @bicube7529
    @bicube7529 10 місяців тому +1

    yeah, i needed the reminder at the beginning of the video, i still wasnt subscribed . i watched like, 2 entire playlists about rust, but they go to fast, i am a programmer, but im a slow one, the fact that you really go into the topics, i feel like i'm exploring the stuff, testing and seeing what happens and then great explanations. great work, keep up, let's grow this community

    • @TrevorSullivan
      @TrevorSullivan  10 місяців тому +1

      You rock! Thanks so much for your support. I'm so happy that you're learning Rust along with me! It's quite the process.