A Practical Guide to Pointers in Go

Sdílet
Vložit
  • čas přidán 8. 06. 2024
  • 🌎 Follow me here:
    Discord: / discord
    Twitter: / tomdoes_tech
    Facebook: / tomdoestech​
    Instagram: / tomdoestech​
    TikTok: / tomdoes_tech
    ☕ Buy me a coffee: www.buymeacoffee.com/tomn
  • Zábava

Komentáře • 21

  • @mohit84604
    @mohit84604 Před 3 měsíci +1

    this is great for clearifyiing the doubts.

  • @samskulj
    @samskulj Před 3 měsíci +1

    Great tutorial!

  • @IkraamDev
    @IkraamDev Před 3 měsíci +1

    Great video, pointers take some time to get your head around.
    Editing goof around 4:20 lol

  • @WebDevCody
    @WebDevCody Před 3 měsíci +1

    The fact that the editor doesn’t warn when trying to access a potentially nil pointer makes me miss typescript. Are you saying all structs should just have some internal value you use to know if the thing was set or not? Like an isInitalized true bool?

    • @TomDoesTech
      @TomDoesTech  Před 3 měsíci +2

      I'm not sure I understand the question, but everything has default values, see this playground: go.dev/play/p/qCJQAwYbCID
      I should do a video on what you posted on twitter the other day about no required values on a struct. It would be a nice feature but there's ways to construct the program so you don't really need it.

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

      Hi Tom, can you please share some ways to handle the construction with having the required check,

    • @TomDoesTech
      @TomDoesTech  Před 3 měsíci +1

      @@dhruvsaxena8254 you can't get your editor to tell you that it's required, but you can use the builder pattern and either return, or panic in the build method if a field is missing.

  • @samarpanharit4268
    @samarpanharit4268 Před 3 měsíci +1

    Nice video

  • @avg_user-dd2yb
    @avg_user-dd2yb Před 3 měsíci

    Should i learn node js or go, iam so confused?

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

      Are you trying to get a job? JavaScript

    • @avg_user-dd2yb
      @avg_user-dd2yb Před 3 měsíci

      @@TomDoesTech want to get into backend and actually also looking for a job,I have tried both but i really want to stick to one and go deeper into it, what do you suggest?

    • @TomDoesTech
      @TomDoesTech  Před 3 měsíci +1

      @@avg_user-dd2yb I think your chances of getting a job are higher if you focus on node

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

    Cool next goroutine and concurrency?

  • @coder_one
    @coder_one Před 3 měsíci +1

    It is a great pity that such a pleasant language as Go is not null safety.... :(

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

      To be honest, it's rare that I come across these issues. That's why I suggest to not use pointers to make properties optional

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

      It's more common in js where everything is nullable

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

      @@jalalle1995 We're talking about Go, so stop getting unhealthily excited about JavaScript and making empty comments about it.

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

      ​@@coder_one let me rephrase it, null bugs are more common in languages where everything is nullable

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

      @@jalalle1995 do you have some kind of programming complex that the only thing you can write when the conversation is about the Go language is that in other languages are like this and like that? Seriously, who cares? Grow up boy!