A Practical Guide to Pointers in Go

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

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

  • @mohit84604
    @mohit84604 10 месяцев назад +3

    this is great for clearifyiing the doubts.

  • @danishsiddiqui7321
    @danishsiddiqui7321 2 месяца назад +2

    great explanation ! found it very helpful

  • @ProphylacticGizzard
    @ProphylacticGizzard 3 месяца назад

    Excellent video, appreciate the example of Request and ResponseWriter. You're spot on that pointers are simple in concept but the tricky part is understanding why should this thing be a pointer, and not this other thing

  • @IkraamDev
    @IkraamDev 10 месяцев назад +3

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

    • @TomDoesTech
      @TomDoesTech  10 месяцев назад

      Don't point it out lol 😂

    • @oluyemiolususi697
      @oluyemiolususi697 2 месяца назад

      😀 I actually enjoyed it. It shows there is always a process to perfection 🥰

  • @maribusa
    @maribusa 5 месяцев назад +1

    Thank you for the great explanation.

  • @samedskulj
    @samedskulj 10 месяцев назад +1

    Great tutorial!

  • @aluranarveez9021
    @aluranarveez9021 5 дней назад

    Super explanation thanks

  • @NiladriBiswasOTC
    @NiladriBiswasOTC 2 месяца назад

    @TomDowsTech Just a small correction, In the video, you mentioned referencing &a by just using *a. That would be correct in case If that would have been a pointer variable. Since, a is a value type variable from the example you have shown here, the dereferencing should be *&a

  • @WebDevCody
    @WebDevCody 10 месяцев назад +2

    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  10 месяцев назад +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 10 месяцев назад

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

    • @TomDoesTech
      @TomDoesTech  10 месяцев назад +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.

  • @danmaina9731
    @danmaina9731 3 месяца назад

    Well explained. I'm having the same issue with interfaces. I don' t when and why to use them. Please make a tutorial on this. Thanks.

  • @avg_user-dd2yb
    @avg_user-dd2yb 10 месяцев назад +1

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

    • @TomDoesTech
      @TomDoesTech  10 месяцев назад

      Are you trying to get a job? JavaScript

    • @avg_user-dd2yb
      @avg_user-dd2yb 10 месяцев назад

      @@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  10 месяцев назад +1

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

  • @samarpanharit4268
    @samarpanharit4268 10 месяцев назад +1

    Nice video

  • @kirakira160
    @kirakira160 10 месяцев назад +1

    Cool next goroutine and concurrency?

    • @TomDoesTech
      @TomDoesTech  10 месяцев назад

      Yeah, I think that's a good idea

  • @coder_one
    @coder_one 10 месяцев назад +1

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

    • @TomDoesTech
      @TomDoesTech  10 месяцев назад

      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 10 месяцев назад

      It's more common in js where everything is nullable

    • @coder_one
      @coder_one 10 месяцев назад

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

    • @jalalle1995
      @jalalle1995 10 месяцев назад

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

    • @coder_one
      @coder_one 10 месяцев назад

      @@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!