justforfunc #18: understanding Go's type aliases

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

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

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

    Your channel is one of the best things I ever found in internet. Thanks so much.

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

    Thanks Francesc for your invaluable videos, an integral part of my continuous learning of this fantastic programming language.

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

    What a great episode! You just did grind everything to the bits! Thanks.

  • @meowmeow70
    @meowmeow70 7 лет назад +11

    thanks Francesc. clear explanation and learned a lot. Could you do episode about package, dependency management strategy for the relatively large project?

    • @JustForFunc
      @JustForFunc  7 лет назад +7

      I was planning on doing an episode on dep ... maybe the time has come!

    • @meowmeow70
      @meowmeow70 7 лет назад

      Awesome! thanks again for great work.

  • @theyruinedyoutubeagain
    @theyruinedyoutubeagain 7 лет назад +5

    19:30 I have the same damn issue with vscode xD Always have to move shit around after I create it. I absolutely love it though, and credit you fully for making me switch to it. Good episode by the way (as always)!

    • @IvanPortoCarreroBE
      @IvanPortoCarreroBE 7 лет назад

      select a file in the root and then create the folder, no more moving around

  • @mybigbeak
    @mybigbeak 7 лет назад +5

    Great episode, I get the same issues recording, I always find the second time is best. Really useful info too. Go aliases. Woo.

  • @AnthonySBD
    @AnthonySBD 7 лет назад +1

    good episode, i wasn't sure how or why id bother to ever use type aliases besides packages changing location / name and this video actually gave me some useful scenarios where it can come in handy.

    • @JustForFunc
      @JustForFunc  7 лет назад +2

      glad you liked it! that was totally the goal of the episode :)

  • @theearthboundkid
    @theearthboundkid 7 лет назад +1

    For channels, I often end up naming a type, just so I can pass groups of things into and out of the channel more easily. With type aliases, it could make more sense to use type chanResults = struct { int; err } or whatever, so that you aren't locking yourself down to one type implementation.

    • @JustForFunc
      @JustForFunc  7 лет назад

      I don't see how using an alias in this case would help over normal types.

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

    Thanks Francesc, I learned learn a lot from your episodes, keep sharing.

  • @nexdev09
    @nexdev09 7 лет назад +1

    I just found your channel. I really enjoy the videos, keep making them.

  • @alesresta
    @alesresta 7 лет назад +1

    Another great episode! Thank you, Francesc.

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

    In the minute 30:55 you finally move the code from the old to the new package but I can't see the difference from it and moving forward without the alias feature.
    I mean I'm lost because I don't see the benefits or even the possible problems, why you can't move code directly from one package to another via copy-paste?
    Thanks for your videos by the way, are amazing!

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

      It think the trick is that you only want to make changes in one package at a time in terms of continuous integration as he mentioned at some point earlier.

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

    Thank you for explaining this, otherwise I would have never understood the point.

  • @johnbalvin5401
    @johnbalvin5401 7 лет назад

    I dont get why at 2:22 it prints "10.00 C", wouldnt be the code for that at line line 13 like "fmt.Println(c.String())" because thats how you call a method?

    • @valdeleplace4536
      @valdeleplace4536 7 лет назад +2

      Method String is "special" because it makes your type implement fmt.Stringer, so implicitly the String method will be called by fmt.Println. See golang.org/pkg/fmt/#Stringer

    • @johnbalvin5401
      @johnbalvin5401 7 лет назад

      thank you so much

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

      That got me too. Justforfunc should have thrown in a little aside to let viewers know about Stringer.

  • @Cutiepie-ky9oh
    @Cutiepie-ky9oh 4 года назад

    Why is it that you can print the celsius without calling `c.String()`?

  • @kitgary
    @kitgary 7 лет назад

    Your VS Code looks beautiful, how can I setup like yours?

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

    Just out of curiosity is there a way where I could find/print out all alias to a type?
    Great Episode btw

  • @buscoopwang8874
    @buscoopwang8874 7 лет назад +1

    I really enjoy the videos

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

    I agree that Fahrenheit doesn’t make sense in general. Freezing is zero, period.

  • @niranjangodbole8784
    @niranjangodbole8784 7 лет назад +16

    farenheit don't no make any sense to me :D hahaa

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

    I promise you dude, as golang popularity grows this channel will escalate

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

    Thanks for making these!

  • @belekabylov
    @belekabylov 7 лет назад

    Instant like for Farenheits joke.

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

    The new.Hello func is calling old.Hello, so just dropping the old code at ruclips.net/video/Vg603e9C-Vg/видео.html will break the CI-build since we did not copy the old implementation over to new.Hello and remove the call to old.Hello, or did I get that wrong?

  • @DJjetseb
    @DJjetseb 7 лет назад

    Am I the only one to think that there will be a lot of abuse regarding aliases which will obfuscate the code in end?

    • @JustForFunc
      @JustForFunc  7 лет назад

      +Just AGuy I think there's a risk people might try to obfuscate code, but that risk exists pretty much with every feature, and the benefits of type aliases are worth it imo

    • @DJjetseb
      @DJjetseb 7 лет назад

      I like the feature too, but I guess we will see what people will do with it.

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

    >= 18, btw.
    Great work, respect!

  • @13TheGUNNER
    @13TheGUNNER 6 лет назад

    good example, thanks !!

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

    Great Great episode,

  • @MrSnack111
    @MrSnack111 7 лет назад

    Very usefull, thanks!

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

    e dentical