Live data from Hacker News

Go Developer Survey 2022 Q2 Results

go.dev

151–160 of 186 posts

Re: Go Developer Survey 2022 Q2 Results

#151
post #77
post #20

Earlier quoted context omitted.

I get constant requests for Node & React (web) and Python (AI / ML) developers. I do a little recruiting in the mobile space too and there’s a small need for React Native but a huge need for native mobile devs.

The reason why you are not getting any requests for Go is because you are not asked to find people for backend.

No, I am. Companies just seem to want their web app backend built on a JS stack, and ask for Node devs.

Maybe Go is more systems/ops heavy, of which I’m not recruiting actively for.

Re: Go Developer Survey 2022 Q2 Results

#152
post #81

Earlier quoted context omitted.

I would love to see some in-depth discussion about this. Even in 2022, I don't think it's clear what we want error handling to look like. You can ask for correctness guarantees from the compiler, but it's easy to ask, it's harder to design a system that actually works. > The lack of exhaustive switch case statements makes this worse because the compiler doesn't care if you're handling all the expected error types (or…

I'd like stuff like myFunc() works as today myFunc()^ returns the err if there is one myFunc()! panics if there is an err

> myFunc()! panics if there is an err

You can do this with generics today:

  func must[T](val T, err error) T {
    if err != nil {
      panic(err.Error())
    }
    return val
  }

  //usage example
  file := must(os.Create("out.txt"))
  defer file.Close()
  bytesWritten := must(file.Write([]byte("Hello World\n")))
We have something like this in our internal utility library. I'm getting some serious mileage out of this when using Go as a script language, where error propagation is not as important as for a regular application or a library.

> myFunc()^ returns the err if there is one

You can also do this with generics:

  func geterr[T](val T, err error) {
    return err
  }
It is true that must() and geterr() are slightly more verbose than single-character operators, but I'd argue having a word instead of a symbol is much more readable. Besides, ^ cannot be used as a postfix unary operator because it's already a binary operator. That would create a grammar ambiguity.

Re: Go Developer Survey 2022 Q2 Results

#153

I begrudgingly use Go. Go really fucked us by not having sum types or exhaustive type-safe switches or pattern matching. It doesn't even have optionals, or type-safe nillables. The error handling is the least of my concerns. Moving on, I'd like to see an ML-like language (with hindly milner) that has M:N threading, with pre-emptive multitasking, and safe concurrency with borrow checker like Rust, with both structural…

Whether it's Thread.new() or go func() or whatever. There needs to be an explicit way to say, "do this concurrently, NOT synchronously". That's pretty much all async/await is trying to accomplish, no?

Re: Go Developer Survey 2022 Q2 Results

#155

Earlier quoted context omitted.

While I was interviewing a few months ago, there were plenty of startups looking for Go developers. Plus, startups reaching out to me about Go jobs.

Semi-counterpoint: I tried interviewing for Go jobs and asked the inconvenient questions early. TL;DR: 11 out of the 12 preliminary interviews were about companies seeking maintainers of "legacy" Go code after important contributors left. Like with you, not an actual representative sample but quite telling at least from where I am standing.

This implies that Go developers move onto something else? That's what I understand from your comment

Re: Go Developer Survey 2022 Q2 Results

#156
post #151
post #77

Earlier quoted context omitted.

The reason why you are not getting any requests for Go is because you are not asked to find people for backend.

No, I am. Companies just seem to want their web app backend built on a JS stack, and ask for Node devs. Maybe Go is more systems/ops heavy, of which I’m not recruiting actively for.

thanks for the reply. and what stack, tools do companies ask for ML/AI recruiting?

Re: Go Developer Survey 2022 Q2 Results

#157

Earlier quoted context omitted.

Semi-counterpoint: I tried interviewing for Go jobs and asked the inconvenient questions early. TL;DR: 11 out of the 12 preliminary interviews were about companies seeking maintainers of "legacy" Go code after important contributors left. Like with you, not an actual representative sample but quite telling at least from where I am standing.

This implies that Go developers move onto something else? That's what I understand from your comment

I'm not implying anything except that maybe greenfield Go projects are not the majority. And even that's under question since I didn't look very far.

Re: Go Developer Survey 2022 Q2 Results

#158

I am delighted with the error handling in Go. Overall I would prefer to Go with the current features and not add more, maybe even deleting some inconsistencies in Go v2.

I find that interesting, and like the Rust way of error handling much more. Go error handling blows the code up a lot and makes the code less comprehensible. res1, err1 = canFail() if err1 != nil { return err1 } res2, err2 = canFail() if err2 != nil { return err2 } return res1 + res2, nil becomes res1 = canFail()? res2 = canFail()? return Ok(res1 + res2) guess what is more readable

The Rust code reads strangely, or at least inconsistently. Why are you returning res1 and res2 over having a magic operator handle them?

I would expect something like:

    canFail()?!
    canFail()?!
The Go code looks like at least some thought was put into the design, even if it is not the best code ever written.

Re: Go Developer Survey 2022 Q2 Results

#159
post #142

Earlier quoted context omitted.

As someone who's not a day-to-day developer/software engineer: the Go code is more readable. The Rust is interesting, for sure, but I don't know what "?" is doing. I like the use of the question mark as it makes the act of calling the function a question - did it work or not? But what's not obvious is what happens if it did not work? What happens then? Where does the error object go? Is there something that represent…

> As someone who's not a day-to-day developer/software engineer: the Go code is more readable. COBOL is what you get when you optimize for readability by people who don't know how to program. > The Rust is interesting, for sure, but I don't know what "?" is doing. I like the use of the question mark as it makes the act of calling the function a question - did it work or not? But what's not obvious is what happens if…

> It gets returned to the next level up, exactly like in the analogous Go code above.

That sounds utterly horrible. You would never actually write that Go code in the real world.

Let's modify the original example slightly:

    res1, err1 = canFailA()
    if err1 != nil {
        return err1
    }
    res2, err2 = canFailB()
    if err2 != nil {
        return err2
    }
Let's assume an error was returned. You realize from the error that there is a bug in the code. Now you're tasked with debugging the code given the error that was presented.

Which function did the error come from? Who knows. And what if canFailA/canFailB return errors from other functions up the stack the same way? Now you've got a massive tree of possibilities to try and work through. A complete nightmare.

In the real world you would take the error and do something with it. Even if you still end up returning an error, it won't be the error you received. It will be a new error that provides pertinent information about the situation.

Go brought forth a legitimate "try" proposal that was very similar to the Rust example and, while well received on the surface, it failed because it was determined that you couldn't possibly use it, at least not beyond toy examples, because of the above.

Presumably Go could introduce a concept of error (it currently has none) which could then include information like stack traces to help with that problem, but that's way more than what you're talking about, and would still lack all the other benefits you get when you handle errors as soon as you get them, not blindly pass them up the stack.

Rust's solution may be nice for Rust, being designed for that pattern. It wouldn't fit well in Go without radically rethinking the language.

> On the other hand, Go will let you forget to handle an error, if you do "res1, err1 = canFail()" but then forget to return an error yourself in the "err1" case.

You can also forget to return res1 (per the original example).

This is a real problem that should be solved, but it's not a problem of errors. It's a problem of values in general. Remember, the Go language has no inherit concept of error. Anything that we happen to call an error is actually just a user-defined type, same as any other type a user might define (birthdate, order number, stock price, etc.).

To frame it as a problem of errors shows a misunderstanding of the problem.

Re: Go Developer Survey 2022 Q2 Results

#160

I am delighted with the error handling in Go. Overall I would prefer to Go with the current features and not add more, maybe even deleting some inconsistencies in Go v2.

I find that interesting, and like the Rust way of error handling much more. Go error handling blows the code up a lot and makes the code less comprehensible. res1, err1 = canFail() if err1 != nil { return err1 } res2, err2 = canFail() if err2 != nil { return err2 } return res1 + res2, nil becomes res1 = canFail()? res2 = canFail()? return Ok(res1 + res2) guess what is more readable

Less lines does not mean more readable. Anyone who has ever programmed will know exactly what Go is doing here(perhaps with exception to nil). Moreso if this were compilable code and every return returned two items as it needs to.

You have to know Rust to understand what the Rust code is doing. Even then, it's not as obvious what's happening under the covers.

Post reply on HN