News for hackers. Stuff that matters.
Re:Go 1.18 Beta 1 is available, with generics by Cthulhu_ on Wednesday December 15, 2021 @08:38AM (#29565703)
There was a spurt of this before they seriously went to work on generics, and the conclusion was "actually, it's fine the way it is". There's huge discussions on the matter as well as various proposals, but they all came with caveats that, in the end, weren't considered a significant improvement.

That said, with generics, it should be possible to change to the 'Either' style [0] of error handling. And with another compiler feature to be added, er, 'exhaustive switch/case' or whatever you want to call it, they can make it a compiler error to not handle the error case. That said, I don't see the language developers or community making it a standard anytime soon.

The current style of error handling doesn't hurt enough. It's verbose and repetitive, sure, but if the alternative is something clever or magic, it's not the way to go.

[0] https://www.scala-lang.org/api/2.13.6/scala/util/Either.html

There are no comments on this comment yet.