Go for JS Devs | Ep. 2 | Pointers

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

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

  • @felipedelima123
    @felipedelima123 4 ปีที่แล้ว +12

    "This looks very bad" I was laughing all along hahaha! How I said before, keep this series going, the content is very good.

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

      Thanks Francisco, really appreciate that! Releasing new videos this weekend.

  • @justdjswap
    @justdjswap 3 ปีที่แล้ว +1

    I like the way you explain Data Structures in middle; please make videos on DS explaning each. Thank you.

  • @ScaddenMan
    @ScaddenMan 3 ปีที่แล้ว +2

    These videos are so helpful as a Typescript developer. Thank you for making in depth content that explains things clearly and in a fun way!

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

    Enjoying this series - Thanks!

  • @rushfordjames
    @rushfordjames 3 ปีที่แล้ว +1

    really great explanation, thanks so much!

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

    Cool!

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

    4:04 🤣🤣🤣🤣🤣

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

    💯✨

  • @arcticape445
    @arcticape445 3 ปีที่แล้ว +2

    Hey man, as a current Typescript dev, your Go videos are very useful!

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

      Thanks ♥️. I had the same background. I have a video coming up on building an API and reusing your express knowledge. Maybe that helps too!

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

      @@Gabzim 🙌

  • @sebastianbarry8803
    @sebastianbarry8803 3 ปีที่แล้ว +3

    Probably a naive question, but what are the benefits of being able to manage pointers directly like in Go as opposed to JS/Node doing it for you. Awesome content btw thank you!

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

      1. You’re able to mutate basic data types, something you can’t do in js.
      2. You’re able to say I “I want to receive a reference” vs “I want to just work on a copy of this object”. In js you need to clone yourself because you always receive a reference.
      3. If you know a bit more beyond the intermediate level, you can do a stack allocation vs heap allocation by the compiler doing escape analysis.
      4. It’s easier to know when a function mutates its inputs by just seeing whether they are values or pointers

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

      Thanks for the compliments btw! Appreciate them

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

      Something else I forgot to mention is that once things are actual values and not pointers to values, zero types become easier. For instance, in go, an `int` can NEVER be nil. same for all of the value types. Only pointers can be nil (and things that use pointers underneath, like channels, interfaces, etc). This makes code simpler to check and write if you are certain you're not receiving a pointer.