Years and years of discussions about Go's poor and verbose error handling, with multiple sensible proposals being rejected, and this is the improvement that finally makes it into a release? What Go demonstrates above all else is how successful a poorly designed language can be if it has a great compiler, an amazing standard library, and high-quality official tooling. Many "features" of Go are borderline insane (date…
> Years and years of discussions about Go's poor and verbose error handling ...with majority of users saying that it's actually great and simple, unlike "usual" approaches... > Many "features" of Go are borderline insane ...which start make sense as long as you use them and put some thought behind the reasons of the design, instead of sticking to "what I used to is the only right way" mentality... > (date formatting)…
New in Go 1.20: wrapping multiple errors
151–160 of 243 posts
Re: New in Go 1.20: wrapping multiple errors
#152Earlier quoted context omitted.
And yet Go is much more popular than Rust.
… is it? For example, the Stack Overflow survey says Rust was loved by 86% of its users, while Go by 64%. Rust also beat Go on the percentage of respondents who wanted to use it. (But Golang was used by 2% more respondents than Rust, at 11.15% vs 9.32%.) https://survey.stackoverflow.co/2022/#section-most-loved-dre...
Re: New in Go 1.20: wrapping multiple errors
#153Earlier quoted context omitted.
> It's literally not a problem at all. It's just one bit of information to remember in your head Your assertions do not make that a reality. > But with Go formatting it's even simpler - you literally never think about it. True, because you quickly learn to use something else.
> Your assertions do not make that a reality What reality? I write Go almost daily for 9 years and was running Golang meetups in two countries for years. I think I have pretty good grasp of what actual problem real people have with dates in Go. Order of day-month in mnemonic ("Jan 2nd" vs "Feb 1st") is literally not a problem. This problem exists only in HN comments of people used to other approaches.
I mean, you literally got it wrong in this comment, so maybe it’s worth considering whether such a simple mistake might be hard to catch and thus cause real production issues?
Re: New in Go 1.20: wrapping multiple errors
#154Earlier quoted context omitted.
> Rust doesn't have nil/null values. Yeah, and it's also not popular. The reason I said "popular" is because the popular languages are addressing pain-points for devs. If nil/null was a pain point, none of the popular languages would allow nil/null values. The simple fact is that, for many developers, there is a pressing need to indicate lack of a value. Languages that don't address this pain-point never really get t…
I don't think anyone gets to say that Rust isn't popular anymore. Especially considering it's now in the Linux kernel.
[1] https://www.theregister.com/2022/12/02/android_google_rust/
Re: New in Go 1.20: wrapping multiple errors
#155Earlier quoted context omitted.
… is it? For example, the Stack Overflow survey says Rust was loved by 86% of its users, while Go by 64%. Rust also beat Go on the percentage of respondents who wanted to use it. (But Golang was used by 2% more respondents than Rust, at 11.15% vs 9.32%.) https://survey.stackoverflow.co/2022/#section-most-loved-dre...
Describing that as "2% more" instead of "20% more" is a bit misleading when comparing just two items.
Re: New in Go 1.20: wrapping multiple errors
#156Earlier quoted context omitted.
So somehow needing a language server to work around language design flaws is alright for Go then.
Sarcasm aside, I do think it’s fair to assume that someone writing code in a modern programming language in 2022 has access to basic language-aware editor tooling. That’s the beauty of the language server. You can look up the implementations of an interface from vim, or some other minimalist development environment, if that’s your bag.
"Well obviously you need a proper IDE to protect you from Go's fuckups"
Cool.
Re: New in Go 1.20: wrapping multiple errors
#157Earlier quoted context omitted.
I feel a lot of that has to do with Googlers not daring to question the famous authors, and the same authors seem to have been asleep for the last three decades in terms of modern programming language developments. I geared up to learn Go one day, got the book and everything, and after just a few hours of trying to write and rewrite error-handling code, I was wondering how this ever got out of the Request for Proposa…
Coming from Python I appreciated that there were no exceptions. I much prefer the explicit error returns instead of exceptions being used for flow control.
Re: New in Go 1.20: wrapping multiple errors
#158Earlier quoted context omitted.
Implicit interfaces are one of the defining features of the language that make it so great, I love them. Calling them borderline insane without any supporting arguments does make me question whether you ever gave idiomatic Go a chance. What do you dislike about them? Re error handling, I've been looking at the proposals and haven't yet seen a satisfying one. Sure, the current error handling is a bit verbose (three li…
> What do you dislike about them [implicit interfaces]? Implicitly implemented interfaces can lead to problems where you're "implementing" an interface because your methods happen to be named the same, but the functionality doesn't adhere to the contract the interface is supposed to represent. Not every contract can be described by the type system, especially not by a type system as limited as Go's. Method names like…
var _ Iface = (*someStruct)(nil)
will fail to compile if someStruct does not correctly and fully implement Iface.Re: New in Go 1.20: wrapping multiple errors
#159Earlier quoted context omitted.
Coming from Python I appreciated that there were no exceptions. I much prefer the explicit error returns instead of exceptions being used for flow control.
But thats the programmer’s fault. You shouldn’t use exceptions for flow control.
The Python community, by and large, embraces "easier to ask forgiveness than permission" and some features in the standard library use exceptions for their flow control. It's much more likely to run into overuse of exceptions in Python than not.
Re: New in Go 1.20: wrapping multiple errors
#160Years and years of discussions about Go's poor and verbose error handling, with multiple sensible proposals being rejected, and this is the improvement that finally makes it into a release? What Go demonstrates above all else is how successful a poorly designed language can be if it has a great compiler, an amazing standard library, and high-quality official tooling. Many "features" of Go are borderline insane (date…
You may not agree, but they are doing what they said they would from the start, and it’s been fairly effective.