3 Golang Tips For Beginners I Wish I Knew Sooner

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 มี.ค. 2024
  • ► Join my Discord community for free education 👉 / discord
    ► Exclusive Lessons, Mentorship, And Videos 👉 / anthonygg_
    ► 33% OFF on my Go + HTMX + Templ Course PRESALE 👉bit.ly/3UFruxO
    ► Enjoy a 60% Black Friday Discount on My Golang Course 👉 fulltimegodev.com
    ► Learn how I became a self-taught software engineer 👉fulltimegodev.com/#mystory
    ► Follow me on Twitter 👉 / anthdm
    ► Follow me on GitHub 👉 github.com/anthdm
    Grab yourself a 33% OFF on the PRESALE event of my building production ready applications with GO + HTMX + Templ + Tailwindcss + JQuery course here: bit.ly/3UFruxO
    Golang interfaces: • This Will Make Everyon...
    Golang package context: • How To Use The Context...
    SUBSCRIBE OR NO MARGARITAS
    ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
    ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
    ╠╗║╚╝║║╠╗║╚╣║║║║║═╣
    ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

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

  • @anthonygg_
    @anthonygg_  4 หลายเดือนก่อน +4

    ► 33% OFF on my Go + HTMX + Templ Course PRESALE 👉bit.ly/3UFruxO
    ► Join my Discord community for free education 👉 discord.com/invite/Ac7CWREe58
    ► Exclusive Lessons, Mentorship, And Videos 👉 www.patreon.com/anthonygg_
    ► 60% OFF on my Golang course 👉 fulltimegodev.com
    Thanks for watching

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

      Hey Anthony, love the content! Just a note, the discord invite seems to be expired

  • @vitiok78
    @vitiok78 4 หลายเดือนก่อน +76

    I like that Go doesn't work with circular dependencies. JavaScript crowd doesn't even understand that any circular dependency is a bold sign of a bad architecture. Go compiler just tells you: "Improve your architecture or get off my eyes!"

    • @eptic-c
      @eptic-c 4 หลายเดือนก่อน

      Yeah but golang imports packages not specific parts of a package. You would hardly have a circular dependency issue in javascript because you are importing only one part of a module at a time.

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

      @@eptic-c Bundlers' tree shaking removes it not the export syntax. The problem is just hidden from you until you get rid of a bundler and start using ES6 modules.

  • @chikken007
    @chikken007 หลายเดือนก่อน +4

    Timestamps
    1:24 do not create too many files (project structure and import system)
    3:08 foucs on learning interfaces
    10:45 learn package context

  • @chandler828
    @chandler828 4 หลายเดือนก่อน +8

    100% agree on interfaces needing to click. I watched 100 videos on them and never really got it. Until I implemented my own Writer. Boom. It all made sense.
    A question I now ask when interviewing devs is “describe an interface in one sentence”
    If a dev can’t do that, we know their go knowledge is lacking. My own answer to that is simply “an interface describes an expected behavior.”

  • @user-dz6il2bx5p70
    @user-dz6il2bx5p70 4 หลายเดือนก่อน

    Those short videos are the best. The ongoing thought process of an experienced engineer giving some small, but very essential tips is awesome. Thanks for sharing!

  • @mokorra
    @mokorra 4 หลายเดือนก่อน +8

    Actually these are some pretty good advices! I’ve been doing a side project in golang for the sake of learning for 4 weeks now and I hit a wall with the circular dependency thing.. Thanks for the tips Anth!

  • @iCrimzon
    @iCrimzon 4 หลายเดือนก่อน +5

    Just started using context after doing a little practice with redis, figured it would become important in the future, nice timing

  • @raptorate2872
    @raptorate2872 4 หลายเดือนก่อน +2

    Thank you for the tips, I been doing gophercises to really explore and learn the intricacies of Go. Your videos have been showing up which have been really helpful throughout my learning journey

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

    Just subbed. Just a suggestion, a high pass filter (or low cut filter) would help with audio quality. Another option would be to increase the distance of the mic to avoid low frequency 'pops'. Thanks for the content.

  • @SumanPokhrel0
    @SumanPokhrel0 4 หลายเดือนก่อน +9

    I recently started learning golang , it's all because of Meleky and your channel . it fun though😁

  • @nanonkay5669
    @nanonkay5669 9 วันที่ผ่านมา

    Circular dependency is very real, I ran into that. Especially because I came from a JS background, and I was very frustrated by it. It's very very real

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

    I really like these small "to the point " advice type of videos :D

  • @mementomori8856
    @mementomori8856 4 หลายเดือนก่อน +2

    my biggest problem as a jr. dev is that I'm too afraid to do things the wrong way, always looking up the best practices and methods instead of actually building something and learn from my mistakes.

  • @abdorootuae
    @abdorootuae 23 วันที่ผ่านมา

    after 6 month i watched this video again and now its make sense for me interfaces are very important like you said

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

    at 8:00 I wouldn't use a reader, I'd pass a pointer to DoStuffWithBytes for payload, that's what they're for. There is a hit on performace when you're using readers / writers to pass data around the program. Just pass the memory address and you don't have to read / write.

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

    One of the best contents that you've made, I like a lot and will apply these tips in my work with go!!

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

    Yeah I thought this type of tips and acting like a pointer to other subjects / videos was good. Keep it up. I'm glad you highlighted the context package because I actually stumbled onto your channel looking for golang REST API videos and I saw you using context a lot without explaining it very much (I can understand for that video its a prerequisite to understand context already). I'm still learning it to get familiar with it for a project I'm building but this video was also helpful for telling me I need to learn more about interfaces because I have seen them but don't know how / when to use them at the time of writing this comment.

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

    Good stuff! A huge benefit of interfaces, and this is true in all languages that have them is testing.
    What if you have code that reads stdin? The easiest way to make it testable is to inject an io reader to a func and use Fscanf in that func rather than just using Scanf--code to abstractions, not concretions. Then, use strings.NewReader in your unit tests. Similarly, with file and network io. Bob's your uncle, easy peasy, coverage 100% achievable.

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

    Very useful tips, thank you Anthony!

  • @kavindusuraweera5726
    @kavindusuraweera5726 4 หลายเดือนก่อน +2

    Could you make a video about production-level Server-Sent Events using Golang?

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

    I have seen your interface videos, Its very much helpful, and I imagine those example whenever I feel like using interface{}, Thanks !

  • @dasmarkopo
    @dasmarkopo 12 วันที่ผ่านมา

    I love them, I have dabbled some with Golang, on and off some year(s). I should make a more serious commitment to code in it. I know for some progress you should code some everyday or at least nearly every day for some time.

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

    I'd love a video about error formatting / wrapping / tagging in web applications. ie, when your errors are encountered in a handler, how do you determine which http status code matches the error?

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

    I faced circular dependency issues while creating tests for my service layer and when mocking my repository layer...

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

    Is there a way to get a discount on your golang course? In Poland almost 200$ is a lot of money...

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

    Great stuff !! 🎉🎉 thanks for your input 😊

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

    Interfaces represent capabilities the call sites call for. Interfaces should be defined in the callsite to realise the dependency inversion principle. The most ideal interface is the one consisting of one method e.g. UserSaver with Save method. This is the application of the interface segregation and dependency inversion principles.

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

    what's the name of that vscode theme?

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

    awesome video ty

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

    Love your videos ❤

  • @SanketDhanawade-pd2cr
    @SanketDhanawade-pd2cr 3 หลายเดือนก่อน +1

    didn't know that Dwayne "The Rock" Johnson also gives Go Lang tutorials Love from India great stuff keep going.

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

    Well interfaces are best piece of advice to beginners. That's really crucial in organising code in manner that your testing and depdency are setup properly. i think beginners should study bit more about the interfaces can be combined to form other interface such as io.ReadWriter or something else.

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

    Great content.

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

    I do like folder for controllers, models, observers, middleware’s, repositories for separating data layer and filters, actions, is that good for a structured backend

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

      No put them in the same folder just name the files different.

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

    Amazing, make more, thanks

  • @VijayRaj-ij4on
    @VijayRaj-ij4on 4 หลายเดือนก่อน

    Always welcomes you

  • @dami-i
    @dami-i 4 หลายเดือนก่อน

    "Everybody is having fun, but in Golang you're not going to have fun."
    Sad, but true.

  • @niko_ade
    @niko_ade 4 หลายเดือนก่อน +10

    Anthony OWNS golang

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

      I confirm

    • @anthonygg_
      @anthonygg_  4 หลายเดือนก่อน +10

      I run this place

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

      can confirm this as golang myself, Anthony owns me

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

    very helpful

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

    Single letter variables are great ONLY if it's quickly used, with a short scope. I use them all the time when I for loop for _,d := range myDataLines but only if it's short -- 5 lines or less. Same with an if statement, or a anonymous function -- ONLY IF it has a short scope. I don't want to be 50 lines down and what the F#$@! is d.

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

    amazing video

  • @burionyt
    @burionyt 4 หลายเดือนก่อน +7

    Maturity is when you realise
    - All the onion, hexagonal bullshit is just using interfaces and structs.
    - You understand why functions need to return error almost all the time. People who hate golang way of handling errors havn't code a big project period.
    - Why a small language like golang(in comparison to scala or some other thing) with less features makes you productive

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

      exactly, especially on point 2! Error handling in Golang is undoubtedly a miracle.

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

    Make more brother!

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

    Nice tips as always. (Btw what is with the red prettier button? :P)

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

      Haha i have no clue. I will delete it

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

      The prettier extension cannot find a binary or .prettyrc file.

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

    3:32 Interfaces and Concurrency is the core of go and I'm having a hard time learning it 😢

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

    7:53 damn i guess im off to a bad start then

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

    Excel create with a million rows and 1000 column using golang

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

    I really hate it when you've forked a repository, you want to modify the code, with the intent of a future pull request. But damn EVERYTHING is a FING Package! SO you've got to change all the includes because the author did a ton of includes to his own software as a package, and now I have to change those includes to match my repository. I could see if if those packages were useful outside the program -- but they're not. I almost never package, unless I can use the package in other code. I do break my code down into manageable chunks. So in my root directory I might have a file for flags.go, filein.go, fileout.go, restcalls.go -- each one describes the code that file may contain. AND the IDE understands the functions in each of these, go doc will even give you comments you made to your code on how to use the functions.

  • @MT87840
    @MT87840 4 หลายเดือนก่อน +2

    The shorter your videos are, the more I'm willing to watch.
    Please make them shorter.
    I like your thoughts and come to only listen to them to learn Go from you.

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

      2 min vids incoming

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

      I'd love it! :)) @@anthonygg_

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

    As a german boring and effective fits perfectly for me

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

    easy to learn, hard to master.

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

    Listen, James, this is not good 😂😂

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

    The only thing I remembered from this video is that I need to play a lot with girls 🥂

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

    Simple and boring are what you want in a language.

  • @Drooidov
    @Drooidov 4 หลายเดือนก่อน +2

    perfect. medium - short videos are fine
    thanks

  • @_ntds
    @_ntds 4 หลายเดือนก่อน +26

    hate to say that, but IMO this vid is mostly yapping. golang newcomers won't understand why would they need interfaces, readers, context etc.. and I think they wouldn't even bother checking out related videos because they didn't see any actual examples here.

    • @Ohhimark100
      @Ohhimark100 4 หลายเดือนก่อน +3

      Agreed.

    • @yega3k
      @yega3k 4 หลายเดือนก่อน +5

      Unless you are 100% new to coding in general, you should know what an interface is. Most languages / frameworks use interfaces. Context is also a common concept. And every language does reading and writing data in some shape or form (at the very least, files and network requests). Even if all you know is JavaScript or Python. If you don’t know these things, maybe focus on learning them first.

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

      @@yega3kI agree , I’m new to go but Im experienced in C++ and PHP , if you don’t know what an interface is you’re most likely at the very beginning of learning programming. Like what are variables level

    • @daltonyon
      @daltonyon 4 หลายเดือนก่อน +2

      I disagree and think this is an important step to you understand. I think if you have been working 1 year with Go, you're still a newcomer. These tips are very valuable and if you don't know what's is a interface, is a good opportunity to learn.

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

      Like and subscribe tho! For more yapping in the future!

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

    Someone here watched some Primagen videos👀

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

    My professor told me if you don’t understand the primitive data types programming isn’t for you Go to the college of business.
    After 6 months I still didn’t get it, she told me to quit programming, and I took it personally.
    I was able to graduate on time, and got a job where she worked at . Then she retired before we could start working together 😂
    It was a mere coincidence

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

      Haha Love this story!.

  • @ThomasWSmith-wm5xn
    @ThomasWSmith-wm5xn 24 วันที่ผ่านมา

    golang was*** a very simple language before these stupid iterators i refuse to use and hate that are part of the language - okay Im done.

  • @xxxPrzybyLxxx
    @xxxPrzybyLxxx 4 หลายเดือนก่อน +3

    I would argue that Golang is easy to learn but hard to master. It's maybe simple but not necessarily easy.

  • @SR-ti6jj
    @SR-ti6jj 4 หลายเดือนก่อน +1