3 Ways to Polymorphism | Advanced Rust Part 2

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 14

  • @if_it_pleases_the_council
    @if_it_pleases_the_council 8 หลายเดือนก่อน +7

    This has to be the best simplified explanation on dispatching on the whole internet. Love the game example too! Keep up the hard work!

    • @GreenTeaCoding
      @GreenTeaCoding  8 หลายเดือนก่อน

      Wow, this has to be one of the nicest comments I received. Thanks for taking the time to write it. I will gladly keep working on the channel :)

  • @maxwellpepper_
    @maxwellpepper_ 5 วันที่ผ่านมา

    Excellent explanation! Much appreciated. Thank you.

  • @alfaex.
    @alfaex. 7 หลายเดือนก่อน

    Very good explanation, it helped me a lot, thanks.

  • @freddysultan711
    @freddysultan711 9 หลายเดือนก่อน

    Thanks so much for your in creating understandable videos of trait and trait objects. Now to your question. I believe generic struct will be the solution.

  • @theintjengineer
    @theintjengineer 9 หลายเดือนก่อน

    Thank you very much.

  • @eligbuefelix7988
    @eligbuefelix7988 8 หลายเดือนก่อน

    Thank you so much. Where do you guys train, how do you get to understand these things to this level.

    • @GreenTeaCoding
      @GreenTeaCoding  8 หลายเดือนก่อน

      You're welcome :)
      I think learning is a life long endeavor, and this is exactly the way I approach coding: I try to learn a bit every day. Sometimes that's 10 minutes, and some days I can spend 4 hours. Just always do something.
      As for resources: I like to mix and match. Books, Udemy courses, TH-cam, blogs. And of course you have to experiment.

  • @lordmelbury7174
    @lordmelbury7174 9 หลายเดือนก่อน

    This is excellent, Love the mechanical keyboard sound as you type! - Is it normal/ok to have more than 1 function in a trait ? eg Lines 2 AND 3?
    Most tutorials I see have just one fn inside a trait.

    • @GreenTeaCoding
      @GreenTeaCoding  9 หลายเดือนก่อน +1

      Glad you enjoyed the content.
      Yes, it is very common to have multiple functions in a trait. It is even possible for one of those functions to use the other, as we will see in an upcoming video.

  • @bbkr2063
    @bbkr2063 5 หลายเดือนก่อน

    So far big downside I found is that you can: fn laundry (item: &T) { item.wash(); item.dry() }. But you can not: fn laundry (item: &dyn Washable+Dryable) { item.wash(); item.dry() }. Can dynamic dispatch over two trait objects be done without workarounds like implementing dummy WashableAndDryable intermediate trait? This quickly makes code murky, because it must consist ad-hoc traits just to satisfy dynamic dispatch trait boundaries. Or am I missing something obvious here?

  • @tofuddreg
    @tofuddreg หลายเดือนก่อน

    vscode theme name? (I bet nobody'd expect this question)

    • @GreenTeaCoding
      @GreenTeaCoding  หลายเดือนก่อน +1

      Dark rose

    • @tofuddreg
      @tofuddreg หลายเดือนก่อน

      @@GreenTeaCoding ty