Shallow vs Deep Copying in Go

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

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

  • @adibhanna
    @adibhanna  4 месяца назад

    What other coding topics would you like to learn about next?

  • @snoodking1
    @snoodking1 4 месяца назад

    So another way to think about the original assignment of Person is the "&" tells the compiler you want to set original to a pointer of the struct Person. This is exactly why original values get overwritten. If you remove the "&" from Person during assignment you are creating a new instance of the struct. If you do it this way you will end up having two instances of Person when you create the copy variable. This avoids the need to use deep copy which is processor intensive. The tradeoff is that you will use more memory since you now have two instances of Person instead of a pointer to one.

  • @blockchaingamedev
    @blockchaingamedev 4 месяца назад +1

    Great video, thanks for sharing.

  • @pedrolemos3030
    @pedrolemos3030 4 месяца назад

    awesome content!

  • @Deffno
    @Deffno 4 месяца назад

    🎉🎉🎉

  • @farzadmf
    @farzadmf 4 месяца назад

    Thanks for the video
    Question: how have you configured your [Neo]vim to show the "special characters" in visual mode but not normal mode? (I means those tabs, spaces, etc.)

    • @adibhanna
      @adibhanna  4 месяца назад +1

      I'm actually using Zed editor in this video, i've been experimenting with it on and off. zed.dev/ check it out!

    • @farzadmf
      @farzadmf 4 месяца назад

      Oh cool, I thought it was [Neo]vim. I saw your video(s) about it; it's in my todo list at some point to take a look.
      Main blocker for me is that I literally live in my terminal, so having a spearate app for code editing is, well, a new challenge that I'm not sure if I'm ready (yet) to tackle

    • @adibhanna
      @adibhanna  4 месяца назад +1

      @@farzadmf yeah, you don't really want to change your workflow if you're already productive in terminal. all these editors use the same LSP, so you're not missing out really. the interesting thing about Zed is that they are adding a lot of Vim features and AI stuff. which make it a valid alternative to Neovim.
      For big projects, I still enjoy using Golang (by Jetbrains), they just have the best LSP and refactoring capability that is too good to be ignored!

    • @farzadmf
      @farzadmf 4 месяца назад

      @@adibhanna I think you mean Goland (not Golang 😆), but yeah, I've heard that it's very good.
      It's been quite a while that I haven't worked with Go, but at the time, I was living with fatih/vim-go, and I liked it.
      Goland of course is another level; not only it's a separate app, but it's paid as well (and not that cheap either) 😆

    • @adibhanna
      @adibhanna  4 месяца назад +1

      @@farzadmf lol yup! Goland! it's really good! they have a plugin called IdeaVim, it's probably the best vim emulation out there

  • @mornsoltice
    @mornsoltice 4 месяца назад

    Hi adib can i ask, how you make spaces beetween line on neovim

    • @adibhanna
      @adibhanna  4 месяца назад

      hi! do you mean, line height? this is usually done on the terminal config, not Neovim

    • @mornsoltice
      @mornsoltice 4 месяца назад

      @@adibhanna oh using font.offset?, btw what font do you use for zed

    • @adibhanna
      @adibhanna  4 месяца назад

      ​@@mornsoltice what terminal emulator are you using?
      I use this font berkeleygraphics.com/typefaces/berkeley-mono/