14 votes

Go 2 Draft Designs

7 comments

  1. [5]
    biox
    Link
    Generics and simpler error handling, plus the addition of an official dep resolver? I already like Golang, but count me a convert if this stuff is implemented.

    Generics and simpler error handling, plus the addition of an official dep resolver? I already like Golang, but count me a convert if this stuff is implemented.

    5 votes
    1. teaearlgraycold
      Link Parent
      So basically everything people complain about is going to be fixed?

      So basically everything people complain about is going to be fixed?

      4 votes
    2. [3]
      kaushalmodi
      Link Parent
      What do you plan to convert from? Have you looked at Nim?

      What do you plan to convert from? Have you looked at Nim?

      1. [2]
        biox
        Link Parent
        Ruby x_x I have not looked at Nim, though Ive seen references to it in my emacs distro.

        Ruby x_x I have not looked at Nim, though Ive seen references to it in my emacs distro.

        1. kaushalmodi
          Link Parent
          Hey! You're an Emacs user too? Hello from a fellow Emacs user :) Btw what do you mean by "emacs distro"? You mean Spacemacs? Does it have a Nim layer? [I don't use Spacemacs, but I wouldn't be...

          Hey! You're an Emacs user too? Hello from a fellow Emacs user :)

          Btw what do you mean by "emacs distro"? You mean Spacemacs? Does it have a Nim layer? [I don't use Spacemacs, but I wouldn't be surprised if it had that layer :)]

          I have been gradually learning Nim, adding notes for that in an Org mode document, and publishing them here.

          1 vote
  2. Celeo
    Link
    Thanks for posting! Unlike (it seems) everyone else, I haven't had problems with the lack of generics, so I can't comment on whether or not the proposed changes there are good. I've definitely had...

    Thanks for posting!

    Unlike (it seems) everyone else, I haven't had problems with the lack of generics, so I can't comment on whether or not the proposed changes there are good. I've definitely had very unpleasant-looking functions with as many if err != nil checks as actually processing data, so their prosed plan for that is really interesting.

    At the time I started learning Go, I'd mostly been using Java, so switching to the multiple return values and explicit error value checking was a pretty big mind-shift. Now that I'm used to it, I don't mind the pattern, but like many, I find the repetitive syntax annoying. I can see that this check -> handle syntax will clean up a lot of my web server code; if a endpoint has an error, regardless of the error, it's going to have to tell the client about the error; the type of error just determines what the client is told (4xx vs 5xx, etc.).

    One thing that I wonder if will become prevalent is handle blocks that look like this:

    handle err {
        return errorHandler(err)
    }
    

    or if that'll be denoted as bad code, as handle blocks that have enough content to send off to another function are indicative of the function that houses the handle block as having too much processing to start with.

    2 votes