Live data from Hacker News

New in Go 1.20: wrapping multiple errors

lukas.zapletalovi.com

241–243 of 243 posts

Re: New in Go 1.20: wrapping multiple errors

#241
post #179

Earlier quoted context omitted.

I'm saying this after 20 years using C++, from AT&T CFront onwards, all the GotW, years of Boost posts, every Modern, Effective and Exceptional book read. I've loved C++, but now it is complex even with my experience.

Again, I'm not saying C++ is not complex. I'm saying the complex pieces fit. And that Go has the problem that the pieces don't fit together. (and that this is because it has a bad foundation) I have more than 20 years of C++ experience. Maybe more than 25. I'm surprised you used CFront 20 years ago. Is this like how in my head the beginning of the Unix epoch was "about 30 years ago" when actually it's almost 53?

Just not counting the last ten years not using directly C++, only following its development for affection ;)

Re: New in Go 1.20: wrapping multiple errors

#242
post #109

Earlier quoted context omitted.

The mistake was designing around "simplicity" - a nebulous, unattainable goal. It's sort of like designing around "happiness" - who is to say what happiness is? Is happiness satisfaction? Ecstasy? Fulfillment? Does it require some sadness? How nebulous it is is really well demonstrated in Pike's talk[0] where he somehow believes that a for loop is "simpler" than methods like "filter" and "map", and makes the very str…

Even for bad/inexperiences/stressed/inattentive/... developers, Go is a minefield. Just a trivial example: trying to use append(x, y) without re-assigning to x? Congrats, it will compile without warnings, work fine for a while, then at one point append will reallocate and bang, have fun letting the newbie debug that on a Friday evening.

I don't understand what you mean by this.

  [~] $ cat main.go 
  package main

  import "fmt"

  func main() {
   x := []int{1, 2}
   append(x, 3)
   fmt.Println(x)
  }
  [~] $ go run main.go 
  # command-line-arguments
  ./main.go:7:2: append(x, 3) (value of type []int) is not used
and if you assign the result of the append to something else, x is unchanged.

Re: New in Go 1.20: wrapping multiple errors

#243

Earlier quoted context omitted.

Perhaps V will be suitable for writing production systems one day. Until then, it doesn't seem suitable for anything outside hobby development.

To be clear, I wasn't telling GP to go and write production systems in V. Even though V has stabilized a lot by now, it's still a pre-v1.0 language and with that it carries potential risks. I suggested to GP to take a look at V, though, because V has a Go-like syntax + it has everything GP is looking for.

Agree with that assessment, particularly relative to what the GP seems to be looking for. Vlang is a great alternative to check out.
Post reply on HN