Golang Tutorial #22 - Interfaces

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 102

  • @michaelroof1969
    @michaelroof1969 3 роки тому +41

    Been programming for 30 years and you have a special gift. You are not only smart, but are able to articulate your thoughts. In my experience, engineers struggle with one or the other. Most don't share the gift of both at your level. Keep shining your light Tim. We hear you.

  • @rewanthtammana
    @rewanthtammana 2 роки тому +5

    It's amazing the way you back-linked concepts to your previous videos on structs & struct methods which are great. A really smart way of execution!

  • @NoBrainCode
    @NoBrainCode 4 роки тому +25

    tim i am waiting to see you post things about projects with golang because you are the best man, your tutorials are incredibles

  • @PaxHominibusBonaeVoluntatis

    I'm almost 50 yrs old and I'm impressed how listening to you makes things so easy - I've never had so much fun with any programming language before. Thank you very much! Keep the good work! Cheers! Bye!

  • @RizwanIshakthesinister
    @RizwanIshakthesinister 3 роки тому +1

    That was the simplest explanation of interfaces I have seen so far. Kudos for showing examples of usage.

  • @aashaydhawal7274
    @aashaydhawal7274 2 роки тому +6

    Probably the best explanation of Interfaces on internet, exactly what I was looking for. Kudos Tim and thanks a ton :)

  • @ivan.angulo
    @ivan.angulo 4 роки тому +3

    I come from JS and wow I finally understand interfaces! I will enjoy the rest of my day.

  • @therealosose
    @therealosose 4 роки тому +48

    Hey Tim I was wondering if you could do a video on projects you can do with golang

    • @arntxy
      @arntxy 4 роки тому +6

      To be honest, basically anything.

    • @sc0820
      @sc0820 3 роки тому

      Project : Let's cal the area of any circle you want

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

    @TechWithTim I must say that "You're one of the best teachers, makes me understand everything with less effort"

  • @hangchen
    @hangchen 3 роки тому +3

    Man you not only look so handsome but also make good explanations on this go interface.

  • @xcvsdxvsx
    @xcvsdxvsx 3 роки тому +4

    I've looked in many other places to try to understand interfaces. They are always like, this is how you make one, this is how you use one, okay next lesson. This is the first place that actually explained it. Thanks, I'm going to pick up from here following your tutorials instead.

  • @SakayaNagii
    @SakayaNagii 4 роки тому +19

    When next video? Goroutines, channels and some other things are still left

  • @MrAverageViewer
    @MrAverageViewer 3 роки тому +1

    Tim, thanks for such a great explanation of Go Interfaces! I searched through several videos & articles, and your style of explaining it finally make it clear!!

  • @jasonshi6916
    @jasonshi6916 2 роки тому

    Great example, this tutorial the best one I found about interface on internet. thanks.

  • @sylvestertweetyhunter1733
    @sylvestertweetyhunter1733 3 роки тому +1

    Nice, this series was wonderful, I hope you continue this topic :)

  • @joelmontesdeoca6572
    @joelmontesdeoca6572 3 роки тому +1

    Great series bro. I used it to remember the syntax but now I realized I want to give Rust a try. lol You are a great teacher/presenter, keep it going!

  • @viswanath660
    @viswanath660 3 роки тому

    Excellent Golang tutorial for beginners. Thanks Tim.

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

    Thank you, this is what i was looking for.

  • @Philantrope
    @Philantrope 3 роки тому

    Thanks for demystifying interfaces. Hope for more Go tutorials from you!

  • @raffiquemuir3887
    @raffiquemuir3887 2 роки тому

    You have a great teaching style... getting to the point while giving examples 👍

  • @dimtass
    @dimtass 3 роки тому +40

    After almost 30 years of OOP languages with classes and objects, they managed to make interfaces in a way that's beats everything else in ugliness. That needs balls.

    • @privateger
      @privateger 3 роки тому +6

      It does look bad.

    • @TroenderTass
      @TroenderTass 3 роки тому

      Go is simply just a poor and ugly language.

    • @SJHunter86
      @SJHunter86 3 роки тому +9

      Go is not an OOP language and isn't meant to be used as one.

  • @andrewpagan
    @andrewpagan 3 роки тому +1

    This cleared a lot up for me thank you so much!

    • @hangchen
      @hangchen 3 роки тому +1

      Sup 4 hour ago guy!

  • @BanibrataDutta
    @BanibrataDutta 3 роки тому +1

    Great tutorial series on Golang. I saw many of your videos while reading the Tour of Go, and few things became clearer on watching these videos. Next is to go for Effective Go. Only thing which I missed in your series is the coverage of Concurrency. Perhaps, if you come back to visit this topic some day in future.

  • @khanhsb15
    @khanhsb15 2 роки тому

    Thank Tim, I know more about go lang programming, it's useful

  • @j0chong
    @j0chong 4 роки тому

    looking forward to the rest of the series!

  • @PourdadDaneshmand
    @PourdadDaneshmand 3 роки тому +1

    Hello Tim, Nice tutorial and very helpful. For meet with golang in basic level, I think this tutorial is perfect.

  • @prithviprakash1110
    @prithviprakash1110 3 роки тому

    Great explanation, thank you for this!

  • @bhuvanpatel5262
    @bhuvanpatel5262 3 роки тому

    thank you so much for golang series and making free😊👍

  • @aiyushg1769
    @aiyushg1769 4 роки тому +1

    Hey, Tim, are you thinking of continuing the playlist?

  • @Babe_Chinwendum
    @Babe_Chinwendum 2 роки тому

    Thank you so much, really appreciate this

  • @shhhhhhKoiHai
    @shhhhhhKoiHai 4 роки тому

    Your way of teaching is amazing. Waiting for concurrency concepts tutorials.

  • @christy
    @christy 2 роки тому +1

    Your tutorials are wonderful, however I want to point to an issue I see with many tutorials and teaching programs, the naming of variables are too general sometimes so it makes it difficult understanding the connections between parts. For example there is an interface named shape and then we name shape as the variable a function receives and then we create a shapes slice and then we do "for _, shape := " so this makes it difficult to understand which ones are connected and not. When studying I tent to create random local names for variables such as "for _, shapeasdf :=" and this helps me focus more.

  • @xphis0528
    @xphis0528 2 роки тому

    Great tutorial!!! Thanks!

  • @nathanbenton2051
    @nathanbenton2051 2 роки тому

    FYI: it helps during the pointer vs. non-pointer examples to run this in main to kinda show the difference: fmt.Printf("fooShapes: %v
    ", fooShapes)

  • @Somethingsomethinglol
    @Somethingsomethinglol 3 роки тому

    Great explanation - thanks!

  • @2cmarx
    @2cmarx 2 роки тому

    Loved it. Thanks!

  • @lakshaysharma1305
    @lakshaysharma1305 3 роки тому

    Please post videos on concurrency, go routines and channels, you really explain very well.

  • @zahidulislam2068
    @zahidulislam2068 2 роки тому

    Good video, Tim; impressed

  • @zamboz01
    @zamboz01 4 роки тому +2

    Will there be goroutines and channels?

  • @cool8888rox
    @cool8888rox 3 роки тому

    Very edifying. Thank you :)

  • @ffzz42
    @ffzz42 3 роки тому +2

    3:11: "the point of interface is that any type/struct that implements the method defined in the interface is considered of that interface"
    me: wait, you mean any struct that implements the interface must implement the methods defined in the interface right? just like in java or c#?
    *sees the syntax*
    me: WTF

  • @webmaster246
    @webmaster246 2 роки тому

    Well explained, thanks , you owned my vote & subscribe cheers !

  • @yuripiffer589
    @yuripiffer589 3 роки тому

    Great video! Thanks

  • @MikeJones-br5pl
    @MikeJones-br5pl 2 роки тому

    bro great video and explanation

  • @AmolGautam
    @AmolGautam 4 роки тому

    Thank you so much. it helped me a lot

  • @li-xuanhong3698
    @li-xuanhong3698 3 роки тому

    Hope this series can be follow up ~

  • @MisterCloud6789
    @MisterCloud6789 4 роки тому

    Yeah Tech With Tim is the best

  • @antisony2008
    @antisony2008 4 роки тому

    I still don't fully get the point of interfaces.
    Why would I want to create an interface if I already added the area() method to the rect and circle structs?

    • @TechWithTim
      @TechWithTim  4 роки тому +2

      You would create an interface so that you can treats all objects that implement the interface like the an instance of the same struct. For example, your function can only take an object of type circle or square if you don’t use an interface. By having an interface you can take a “shape” which means the square and the circle get treated the same, so long as they implement the interface. So you have access to the same method names on each object. Hope that helps!

  • @SarfarazAhmad89
    @SarfarazAhmad89 2 роки тому

    rect area :D jokes apart you are an amazing teacher.

  • @robertpearce6642
    @robertpearce6642 3 роки тому

    Thanks for the info

  • @dreamerpreethu5302
    @dreamerpreethu5302 2 роки тому

    I understood the pointer concept and the use of pointer in normal variables and in methods , but I didn't understand the use of pointer in this interface. Can you please explain that why we want to pass the adress while using interface

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

    Thank you for the great video, but one crucial remark, in Go structs are not objects and cannot be referred to as objects they are like an envelope of defined data. Thank you

  • @salmaan6094
    @salmaan6094 4 роки тому

    When will we see more golang videos @Tech With Tim?
    We are waiting eagerly for more videos.

  • @MustbeTheBassest
    @MustbeTheBassest 3 роки тому

    Great video! It feels like GoLang's interface is a convenient form of abstraction? It feels similar to defining a new class in python.

  • @FPChris
    @FPChris 2 роки тому

    Now how does generics alter this?

  • @krtirtho
    @krtirtho 3 роки тому

    "JavaScript doesn't need/have interfaces"
    *Typescript enters in the room*

  • @imteyazraja5613
    @imteyazraja5613 4 роки тому

    Great tutorial Tim.. Really liked the way you explain.. Can we more advanced tutorial on golang?
    Rest / grpc API in golang... Thanks

  • @gnul
    @gnul 3 роки тому

    Did you stop going to go with go?
    Access mod*** I mean naming,
    asynchronous stuff with e.g. goroutines,
    and project structure, file structure, conventions and so on is missing, would love to see more. :)

  • @amankaushik5833
    @amankaushik5833 4 роки тому +1

    Hi, Tim, I have been following your channel for a time now, I am a 13-Year-Old and wanted to know that how do you practice python because I still come across code that is written programmatically also which framework do you use for app development?

    • @craiglobo2165
      @craiglobo2165 4 роки тому

      Kivy is generally what he uses with python app development or otherwise like Java based android programing

    • @wanderingwanderer1016
      @wanderingwanderer1016 4 роки тому

      Kivy is used to make mobile apps with Python. If you want to build a web app, you can use something like Django, Flask or Fast API

  • @SriRam-fk9fq
    @SriRam-fk9fq 3 роки тому

    Good one!

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

    I completed Tutorials videos :). Then What to do Where do I implement this.
    How to implement into projects

  • @slayeeerrr
    @slayeeerrr 2 роки тому

    This example for "interface{}" is overused in most videos and articles with the same variable, function, and struct names. Is it a copy & paste as well or what?

    • @slayeeerrr
      @slayeeerrr 2 роки тому

      You should at least demonstrate the flipside that "interface{}", as it is the base type of any datatype in Golang.

  • @derrick7968
    @derrick7968 3 роки тому

    Hi Tim, You are the best man, I love your explanation. keep going.

  • @hdrstudio8921
    @hdrstudio8921 3 роки тому

    Finally I found, what is the reason for using interface..

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

    What about empty interfaces?

  • @WLockIV
    @WLockIV 4 роки тому +1

    Thank you for the lesson! I do wish implementing interfaces was more explicit in Go

  • @saurabhjain6745
    @saurabhjain6745 2 роки тому

    can you please make videos on golang rest api's and advance golang stuff like channels, go routines

  • @MarKac9090
    @MarKac9090 4 роки тому

    where to download this code?

  • @RAHULROY-zo6by
    @RAHULROY-zo6by 4 роки тому

    Hii Sir, I have learnt progamming in golang, How to start development side learning in go for building microservices, Rest . Can you please guide me any course or content

  • @hemantpreetsingh2752
    @hemantpreetsingh2752 2 роки тому

    thank you

  • @TheF00L-h4d
    @TheF00L-h4d 4 місяці тому

    Leave it to Tim to take you from zero to programming a chip-8 emulator in a day

  • @shivangitomar5557
    @shivangitomar5557 3 роки тому

    Amazing!!!

  • @jacobstech1777
    @jacobstech1777 3 роки тому

    could you please continue?

  • @alfabinomial6183
    @alfabinomial6183 3 роки тому

    thanks

  • @ko-Daegu
    @ko-Daegu 2 роки тому

    I can think of multiple issues this way we don't know what func got what interfaces thou
    as func doesn't implement it (for example like extending an interface in java)

  • @mohamadkenway5140
    @mohamadkenway5140 4 роки тому

    do u start golang pro course ?
    is this last video ?

  • @caleb7327
    @caleb7327 3 роки тому

    Please make a gui-toutorial.

  • @TheWorpler
    @TheWorpler 2 роки тому

    very nice explanation.

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

    You should do udemy courses. You have a knack for teaching.

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

    This is great but you didn't cover scopes.

  • @sumayyahassan6682
    @sumayyahassan6682 2 роки тому

    sheldon cooper?

  • @abhishek7969
    @abhishek7969 4 роки тому

    👍

  • @philippurwoko
    @philippurwoko 4 роки тому

    Please create open ai gym tutorial next time

  • @thachnnguyen
    @thachnnguyen 10 місяців тому

    1. It'd help to organize before making the video (stop repeating yourself), 2. references are not the same as pointers. One last thing: the pointer has that C-stigma thing. Unless necessary, don't bring it up. Modern languages don't need to talk pointers all the time.

  • @frenzygamer907
    @frenzygamer907 4 роки тому

    2nd