Exciting Go Update - v1.22 Change Log With Examples

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

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

  • @DarioNecco
    @DarioNecco 9 หลายเดือนก่อน +4

    Love the way you summarize the new features! Thanks for the hard work

  • @andreagiummarra8385
    @andreagiummarra8385 9 หลายเดือนก่อน +3

    Good work! Thanks… Which tool did you use in this video for graphical schema?

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน +1

      That's a tool called Exalidraw and it's amazing.
      You can easily selfhost it using Docker.
      excalidraw.com

  • @melisvandenbrink2779
    @melisvandenbrink2779 9 หลายเดือนก่อน +2

    Thanks for explaining the loop variable "problem" so clearly - have read a lot about it, but your explaination illustrated the underlining Go runtime workings which caused the behaviour.

    • @giulioguarnone5948
      @giulioguarnone5948 9 หลายเดือนก่อน

      I've never go this "problem" cause I've always tought that every goroutine has its proper scope :
      [...]
      go func(vcopy string) {
      fmt.Println(vcopy)
      }(v)
      [...]

  • @omarelkareh5544
    @omarelkareh5544 9 หลายเดือนก่อน +8

    Even thou you have a point, passing the current name as a parameter to the go routine function pretty much solves the issue

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      Agreed, although this is a very common mistake I've seen way too many times in code reviews. And out in the wild of running code.

    • @brentsaner
      @brentsaner 9 หลายเดือนก่อน +1

      I mean, it's in every piece of documentation surrounding goroutines. This definitely isn't obscure. It's just like off-by-1 errors- devs just simply not paying attention.

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      Sure it's well known, still often occuring.
      And if it's happening a lot, then it's an UX issue.
      Simple change that will help a ton developers.

    • @brentsaner
      @brentsaner 9 หลายเดือนก่อน +1

      @@programmingpercy "UX" for a language is silly. Consistency and capability of a language come MILES before attempting to babysit PEBKAC.

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      I don't know if I'd call it Silly, I think it's an important aspect for Adoptability.
      We may call it DevExp if you like that more.
      Well, wouldn't you say Go already has great compability and consistency? So what's wrong with tending to the more junior developers?
      I don't see any harm in this improvement

  • @cariyaputta
    @cariyaputta 9 หลายเดือนก่อน +2

    Thanks for the examples.

  • @_us.m.an_
    @_us.m.an_ 5 หลายเดือนก่อน +1

    Thank you!

  • @alexandreprince914
    @alexandreprince914 9 หลายเดือนก่อน +3

    Thank you for the video dude !! keep goin

  • @salvaje1
    @salvaje1 9 หลายเดือนก่อน +2

    The main reason I was using third party libraries for http was the dynamic paths. Now I don't need to.

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      I feel the same way!!

    • @dilungasr1322
      @dilungasr1322 9 หลายเดือนก่อน

      What about subrouters?

  • @peace-wink
    @peace-wink 9 หลายเดือนก่อน +4

    Great video, keep up the good work 😊👍

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน +1

      Thank you for watching and enjoying!

  • @dhaw
    @dhaw 9 หลายเดือนก่อน +4

    Amazing , Love your explanations !

  • @prashlovessamosa
    @prashlovessamosa 9 หลายเดือนก่อน +4

    Thanks Percy for sharing.

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน +1

      Thank you for watching!

    • @prashlovessamosa
      @prashlovessamosa 9 หลายเดือนก่อน

      Percy can you suggest me some books I wanna learn Networking stuff with Golang
      I am learning Golang from Orielly Cookbook the Network module was super interesting
      ​@@programmingpercy

    • @prashlovessamosa
      @prashlovessamosa 9 หลายเดือนก่อน

      Hey Percy can you please suggest some books for Networking stuff in Golang
      I was learning Golang from the Orielly Go Cookbook their Networking module was so fascinating
      Are there any books or docs in your mind apart from official.

  • @luisweck5285
    @luisweck5285 9 หลายเดือนก่อน +2

    for range on ints is pretty cool too!
    for example, you can now write benchmarks as: for range b.N { ... }

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      Amazing! Didn't even think about that!
      That is a nice improvement indeed!!

    • @brentsaner
      @brentsaner 9 หลายเดือนก่อน

      Ints or uints? How does it handle a negative integer as the range start?

    • @luisweck5285
      @luisweck5285 9 หลายเดือนก่อน

      @@brentsaner just tried it. The loop is not executed

  • @PiyushBhatnagar-h3p
    @PiyushBhatnagar-h3p 9 หลายเดือนก่อน +5

    Sir make a series and deep dive into net/http

  • @diegoclairr
    @diegoclairr 9 หลายเดือนก่อน +2

    Very good video, thanks 🎉

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน +2

      Thank you for watching! Makes it more fun to make these things when people watches it

  • @arturfil
    @arturfil 9 หลายเดือนก่อน +2

    Thank you for the videos! I'm also have been learning and programming in go for the past two years, do you have any books that you recommend the best for microservices? I was looking into DDD by Matthew Boyle and EDD by Michael Stack

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน +1

      Nice to hear you are using Go, sure is amazing!
      Regarding DDD I'd recommend Eric Evans book, though it is a handfull to take in.
      A slightly simpler version is Implementing Domain Driven Design by Vaughn Vernon. It's a bit slimmer and more Concrete.

  • @strahinjamalabosna
    @strahinjamalabosna 9 หลายเดือนก่อน +2

    I'm sorry but I'm trying to understand how is for loop + goroutine behavior a bug. What you are doing here is neither bad practice nor a freak behavior. It is behavior that is entirely expected from this code that is by all measures incorrectly written.
    THIS is the correct code that does exactly what you would expect:
    ```
    names := []string{"Strale", "Caka", "Strahinja"}
    for _, v := range names {
    go func(name string) {
    fmt.Println(name)
    }(v)
    }
    ```
    Example shown here (in the video) disregards basic concepts of multi threading that are surely covered on every computer science course on the planet.
    Now, I'm not trying to be rude and I very much apologize if that is the way I'm coming across. However, considering that there's no actual bug being presented here, how is this update a solution instead of an ability to allow programmers to write code that is, by every possible measure, bad?

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      I do understand your point and I do agree to some degree.
      It is doing what's expected.
      The problem is that there are too many developers that make the mistake, proven over and over.
      So many times that it's an apparent issue.
      You're not rude, you're just stating your opinion.
      I do try in the video to explain that it is expected behavior by showing what's actually happening.
      The issue is that it's to easy for many developers to not understand that.
      One might argue that's it's a unnecessary change because any decent Linter will prevent you from doing this mistake.
      But then we have reality, people don't use linters, people misunderstand things.
      The change won't harm anyone, but it will make it harder for people to screw up, so it's a win according to me.
      With the logic that people should just learn to understand, we wouldn't need a GC. If people just learn to free up mem and handle everything as they are suppose to, the GC is just pointless. Logic is sound, but reality is another beast.

    • @strahinjamalabosna
      @strahinjamalabosna 9 หลายเดือนก่อน

      @@programmingpercy You do make a good point. If majority makes a mistake than it makes more sense to create means to correct a mistake than to expect all those people to get better. Thanks for the explanation

  • @Nerd2k7
    @Nerd2k7 9 หลายเดือนก่อน +3

    Imho these adjustments in go weren't needed. E.g. the for loop adjustment is simply required or at least it seems due to the fact that the people don't actually know what there doing or how the language works. I'm fine with them but i would the core team to focus on something else

    • @programmingpercy
      @programmingpercy  9 หลายเดือนก่อน

      I'd argue the for improvement is much needed. Too many silly bugs.
      I know its simple to fix the for issue, but it is too simple for new goers to miss understand the old implementation and make mistakes.
      The Servemux changes aren't needed either, but they are a nice UX upgrade to the http lib. I welcome them!
      Also the changes on the slices package are pretty sweet.
      But sure, most of the changes were UX improvements to make it easier.
      I like easier.

    • @brentsaner
      @brentsaner 9 หลายเดือนก่อน +1

      100% agreed. They spent time on *this* and NOT ENUMS?!