Go For JS Devs | Ep. 1 Cont... | Structs

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

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

  • @hutxhy4071
    @hutxhy4071 2 ปีที่แล้ว +1

    Hey Gabriel! Thanks again for the awesome videos.
    Is there a concept of static vs instance methods?

    • @Gabzim
      @Gabzim  2 ปีที่แล้ว +1

      Hey thanks for the comment and question. The way I'd approach static methods is to have top level functions at the module level. In that sense, there’s no direct equivalent. But that’s ok because idiomatically they are equivalent since maybe go is not object oriented in the traditional sense.
      You’d end up calling these functions like: math.Pi, so it looks like a static method when you invoke it because you need to prepend the module name. But it’s a great observation and I hadn’t considered this. Thanks for bringing it up.

  • @cmdv42
    @cmdv42 2 ปีที่แล้ว

  • @maghidini
    @maghidini 4 ปีที่แล้ว

    Awesome dude!