Advanced Golang: Generics Explained

Sdílet
Vložit
  • čas přidán 3. 06. 2024
  • Generics help you to do more with less code, by using generic types instead of concrete types. While Generics have been part of other programming languages for quite some time, Generics was only recently added to Golang as of the 1.18 release in 2022. Generics can be used to define functions, structs and maps.

Komentáře • 83

  • @David-xy4nw
    @David-xy4nw Před rokem +37

    The way you explain things are too good brother ! Hopefully you are going to make a series on advanced golang, I am sure it would be the best stuff out there 🚀💪

  • @pmoieni
    @pmoieni Před rokem

    This was awesome. I wish you had more subscribers, you really deserve it. Keep up the good work... 👏

  • @spruslaks26
    @spruslaks26 Před 4 měsíci

    The best introduction to generics-huge thanks!

  • @BorisIsASpider
    @BorisIsASpider Před rokem +4

    Nice! keep these videos coming Ryan

  • @user-uu7ne1yy3c
    @user-uu7ne1yy3c Před 3 měsíci

    Amazing intro to Generics and that Map Comparable explanation was really T -- spot on

  • @njengathegeek
    @njengathegeek Před rokem +5

    You have explained it so nice, now we want 12hr full course, too good to be a 10 min tutorial 😂😂😂

  • @yasindce1998
    @yasindce1998 Před měsícem

    Explanation is Top Notch. I clearly understood everything.

  • @Tridib_Tinkel
    @Tridib_Tinkel Před rokem

    Love the way you teach, very calm

  • @codelinx
    @codelinx Před rokem +1

    This is so clean and we'll explained. Thank you

  • @zoremeth7820
    @zoremeth7820 Před rokem

    Great video once again! Clear and relevant examples well explained

  • @learntocode1708
    @learntocode1708 Před rokem

    Love the way you explain generics

  • @andyyarys4467
    @andyyarys4467 Před 15 dny

    Thank You! All very clarify and helpful.

  • @codewithtee
    @codewithtee Před 7 měsíci

    This is really a very great video and I am so happy I found your channel... I would developed a package I am working on much better if I had seen this video first.. Thank you very much Ryan

  • @cavila0217
    @cavila0217 Před rokem

    Hi Bud, it was definitely a tip-top explanation, thanks a bunch!

  • @blackswan2020
    @blackswan2020 Před 3 měsíci

    my new favorite golang channel -- ty Ryan

  • @SeleckPlays
    @SeleckPlays Před 11 měsíci +2

    One of the better tutorial on Generics I have watched. Concise, to the point, and thorough. Thank you!

  • @esra_erimez
    @esra_erimez Před rokem +45

    While I'm not a fan of generics, I am a fan of this channel. Great video, well done!

    • @AdharshMk96
      @AdharshMk96 Před 10 měsíci +5

      Damn i was actually waiting for generics at one point. Which solved Lots of problems for me

    • @thingsiplay
      @thingsiplay Před 8 měsíci

      Good to see you here as well.

  • @francogiulianopertile279

    Muy buen video, me encantó la explicación de Generics, simple y concisa.

  • @tobiadeniji6630
    @tobiadeniji6630 Před 5 měsíci

    First time watching your video. Amazing content, keep up the good work.

  • @AseDeliri
    @AseDeliri Před rokem

    Great explanations, well done.

  • @abhiiyenger1294
    @abhiiyenger1294 Před měsícem

    Thanks a lot!! Well explained!

  • @olegcharnyshevich1127
    @olegcharnyshevich1127 Před rokem +3

    Awesome video and author!

  • @shgh6242
    @shgh6242 Před rokem

    👍 Nice 👍 job 👍 very helpful, short kept and to the point.

  • @esra_erimez
    @esra_erimez Před rokem +9

    You have an awesome voice. So ASMR!

    • @hp67c
      @hp67c Před 21 dnem

      And plus it reminds me of Agent Smith, which shouldn't be a good thing, but it is. And yes, very clear explanations, excellent examples. I immediately subscribed.

  • @tharouetmaamouri9831
    @tharouetmaamouri9831 Před 5 měsíci

    Brilliant, Thanks for this...

  • @sirajul-anik
    @sirajul-anik Před 7 měsíci

    you should make more videos man. appreciated.

  • @kutmanamangeldiev4967
    @kutmanamangeldiev4967 Před 11 měsíci +1

    you made it as a piece of cake )) cool , good explanation

  • @amirreza3638
    @amirreza3638 Před měsícem

    Great video, thanks ❤

  • @DavisTibbz
    @DavisTibbz Před rokem

    Fantastic as always bro

  • @acronproject
    @acronproject Před 7 měsíci

    Thanks for this useful content about Generics very thanksfull

  • @kamilziemian995
    @kamilziemian995 Před 7 měsíci +1

    4:55 I think alias would be `type UserID = int'. Now UserID is a new type with underlying type of int.

  • @mrmakra-eo1kx
    @mrmakra-eo1kx Před rokem

    new to the channel really liked the video 😁

  • @carlosramirezvera8645

    excellent explanation!

  • @diegoparraca
    @diegoparraca Před rokem

    Waiting to buy your golang course :), realy nice vídeo btw

  • @tmurchjr
    @tmurchjr Před 11 měsíci

    Great stuff as usual.

  • @badrbadr3793
    @badrbadr3793 Před rokem

    Great video dude love it

  • @princeofxane
    @princeofxane Před rokem

    Best Go tutorial on CZcams.

  • @rogvids
    @rogvids Před 5 měsíci

    Great video

  • @user-ky1fv4ul2c
    @user-ky1fv4ul2c Před 5 měsíci

    Thank you!

  • @randall.chamberlain
    @randall.chamberlain Před 11 měsíci

    I'll be damned, just what I was looking for. Word by word. Thanks mate.

  • @eternaldoorman5228
    @eternaldoorman5228 Před 11 měsíci

    8:42 map could be any type. You could have an array of some structures and map a function that goes from structure to structure. The type inference ought to be able to handle everything. I know it can in Standard ML which was around in the eighties.

  • @therealherbzy
    @therealherbzy Před rokem

    Great video!

  • @kamilziemian995
    @kamilziemian995 Před 7 měsíci

    Nice video.

  • @lotfikamel5947
    @lotfikamel5947 Před rokem

    I hope you do a full advanced serie of go

  • @zakariachahboun
    @zakariachahboun Před rokem

    i already know about generics in Go But the way that you explained it and your deep voice is just cool hhhh

  • @minicime8516
    @minicime8516 Před 5 měsíci

    Good vid my man

  • @chang112x
    @chang112x Před 2 měsíci

    Amazing!!!

  • @WorkHome-qv7kk
    @WorkHome-qv7kk Před rokem

    How do you bring the terminal from the top? The one that pops up from the top

  • @OmarAbdelaziz__47
    @OmarAbdelaziz__47 Před rokem

    well explained!

  • @rolandinnamorato1953
    @rolandinnamorato1953 Před rokem

    that audio quality though 10/10

  • @flamejoy2843
    @flamejoy2843 Před 8 měsíci

    Thx a lot

  • @scottspitlerII
    @scottspitlerII Před rokem +1

    Man’s got a radio show host voice

  • @mr.x5582
    @mr.x5582 Před rokem

    Awesome!!!

  • @maury2000
    @maury2000 Před 2 měsíci

    nice vid!

  • @mdkawsarislamyeasin4040
    @mdkawsarislamyeasin4040 Před 10 měsíci +2

    Please create a playlist for beginner 🙂

  • @blankos1817
    @blankos1817 Před 2 měsíci

    i have a question... why on minute 3:20 he creates an interface and not a struct?

  • @body_clock
    @body_clock Před měsícem

    how do you have your terminal come down from the top like that?

  • @jayantasamaddar1446
    @jayantasamaddar1446 Před rokem

    At 4:25 I notice the interfaces being declared with the types and they have a `~` prefix. While you explain what it does, it seems like I can't find any resource for it. Can anyone link me a resource on the official website? Also I don't see the point of using Generics with Maps.

  • @WorkHome-qv7kk
    @WorkHome-qv7kk Před rokem

    1:45 how did you change both types together

  • @MrYerak5
    @MrYerak5 Před měsícem

    What happens on error like deviding two empty strings?

  • @sarevoker
    @sarevoker Před rokem

    Nice intro to the topic buddy! I'm coming from C++ and I think Go's approach to generics is very clear and keeps the language simple.

  • @mr.random8447
    @mr.random8447 Před rokem

    GoLand IDE worth it? Saves time?

  • @fadhlirahim
    @fadhlirahim Před 5 dny

    what a voice!

  • @mwnkt
    @mwnkt Před rokem

    Where have you been all my life.

  • @sajidurrahman7903
    @sajidurrahman7903 Před 5 měsíci

    You are using Goland IDE. You can just click the green button to run the program. Why are you using terminal instead? Specific reason? Just curious.

  • @OpenDeepLearning
    @OpenDeepLearning Před rokem

    are you using a hackintosh?

  • @OpenDeepLearning
    @OpenDeepLearning Před rokem

    Do you use a mouse or a touchpad?

  • @kumar-jatin-2000
    @kumar-jatin-2000 Před 3 měsíci

    🤓: Generics
    🧐: Parametric Polymorphism

  • @user-bh8xz4xy7o
    @user-bh8xz4xy7o Před rokem

    Hi from Russia and thank u so much for such a simple and understandable explanation))

  • @terryphelps4204
    @terryphelps4204 Před 9 měsíci +1

    Good video. You don't do all the annoying shit that other do way too much of: background music, showing excitement ("Hey!! What's up, CZcamsrs?!!"...), silly sound effects, etc. Just pass along knowledge to people who want to know.

  • @enkiimuto1041
    @enkiimuto1041 Před 11 měsíci

    Considering it is official it is odd you can't just call something like "ordered" in the import.

  • @hananasyrawi5206
    @hananasyrawi5206 Před rokem

    I like u voice tho

  • @headlinerbeats
    @headlinerbeats Před 10 měsíci

    I dont get why go has no proper array functions like map filter and reduce natively just like js/node. Even with generics, the fact that you always have to code that up is ridicioulos. Makes me not want to commit to Go tbh

    • @p19shelt
      @p19shelt Před 6 měsíci

      one of my mayjor deciding factors whwn wanting to code my startup. I need expressiveness, which most of my apps is filtering data.

  • @kamurashev
    @kamurashev Před rokem +3

    Generics in go are ugly. Why the hell does it not infer type automatically? It looks like not generic but more like “multi typing” and syntax is also ugly.
    Video is cool though 👍

  • @olsuhvlad
    @olsuhvlad Před rokem

    9 That was the true Light, which lighteth every man that cometh into the world.
    10 He was in the world, and the world was made by him, and the world knew him not.
    11 He came unto his own, and his own received him not.
    12 But as many as received him, to them gave he power to become the sons of God, even to them that believe on his name:
    13 Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God.
    14 And the Word was made flesh, and dwelt among us, (and we beheld his glory, the glory as of the only begotten of the Father,) full of grace and truth.
    (Jn.1:9-14)

  • @kevinkkirimii
    @kevinkkirimii Před 11 měsíci

    Just use and save the hustle unless one truly requires generics. Go generics are not as great.

  • @amr3162
    @amr3162 Před 10 měsíci

    Generics in go are really ugly. wish the type system was a bit smarter

  • @awesomedavid2012
    @awesomedavid2012 Před 8 měsíci

    Great video