This thread is rife with "Go should have Try because I want Try" that also seem to be made by developers that do not write Go. It seems confusing to me that voices generally involved from Go are so demanding of its maintainers. Curious, are there full-time (or at least Primary) Go developers that are upset by the lack of Try?
I write a lot of go in the context of web(micro)services. In stateless services it’s almost always better to bubble up the error and let the caller retry. So I hate the current error handling in this context, it’s a verbosity tax with no value add. Am ambliviant about try though
Declined Proposal: A built-in Go error check function, “try”
401–410 of 425 posts
Re: Declined Proposal: A built-in Go error check function, “try”
#402Lack of try and go's error handling is part of my attraction to go. Explicit handling of error is much better than implicit and having to guess how things might get handled.
Re: Declined Proposal: A built-in Go error check function, “try”
#403Earlier quoted context omitted.
I think try is jumping the gun. Implementing try now is splitting the community and introducing what will likely be new technical debt. It doesn't fundamentally change things, it only makes the language more complicated in a way that's both weird* and likely to become obsolete once generics are a thing. They should focus on xerrors for now and wait until generics are implemented and try again. * weird as in there are…
I expect that once we get generics we are going to get a host of differently implemented variations of the error monad none of which is used by the standard library. Which I think is worse then try. In a broader sense I am deeply irritated by the part of the go community's culture that seemingly sees any effort to make go more "don't repeat yourself" to be making it more complex. With no acknowledgment that avoiding…
Re: Declined Proposal: A built-in Go error check function, “try”
#404Earlier quoted context omitted.
Indeed, I like to think of Go as basically the opposite of Lisp.
Its funny that Go keeps going on how simple it is. Which scheme is much more simple then go will ever be.
Re: Declined Proposal: A built-in Go error check function, “try”
#405Earlier quoted context omitted.
If you're rethrowing the exception, what happens in the VM if that exception is not caught? IIRC, the VM exits, so, it's not at all identical. There are potentially severe nonlocal effects and you're already coding defensively by putting a catch/rethrow.
As far as I know, you didn't get a supervisor for free in Elixir either, you decided to use one, and spent some time determining how to configure it to recover from its child processes failing. In Java, you can similarly put a try/catch at a higher level in the call tree and decide to retry everything on error. Now, Erlang processes don't share state, so that makes them easier to "handle" when they crash, I'm not den…
Re: Declined Proposal: A built-in Go error check function, “try”
#406I created my own proposal that I think addresses the issues. I would love some constructive feedback. https://github.com/golang/go/issues/33161
Re: Declined Proposal: A built-in Go error check function, “try”
#407A lot of Go programmers didn't like this proposal at all. I'd like to think this is just because they didn't think it was good enough. However, it seems that many, many Go programmers didn't like it because they think Go error handling is just fine the way it is.
I don't really care about try/catch, I'd just rather they come up with a standard for wrapping errors so there is more visibility as they get bubbled up. Currently you can write code to do this but most packages will not be doing the same. There also will always be some member of your team fighting you about "simplicity" when you talk about wanting to have more info than a string to log.
Re: Declined Proposal: A built-in Go error check function, “try”
#408Earlier quoted context omitted.
With the difference that Visual Basic is an academic language full of needless features from Go's community point of view.
Visual Basic is hardly academic; they is a tremendous amount of line-of-business code that has been written in VB over the past 25 years. But yeah, Go dev do not see VB's features as being "features."
Re: Declined Proposal: A built-in Go error check function, “try”
#409Re: Declined Proposal: A built-in Go error check function, “try”
#410Earlier quoted context omitted.
My preferences are that error handling is expressed in and enforced by the type system (Haskell's Maybe/Either, Rust's Result), that common error handling tasks be supported by the standard library and by specialized syntax when necessary (Haskell's many Monad/Applicative tools, Rust's "?" operator), and that if a developer neglects or chooses not to handle an error that the most likely outcome is that it bubbles up…
the amount of work they do -- and the code produced, and thus the work reviewers have to do -- should be proportionate to how unusual the necessary error handling is. Great comment. I would add how unusual _and critical_ . One of the things I love about Python is that while I know errors can occur on practically every statement written, I only have to add error handling for likely / expected / critical errors. Any un…
Or try Rust. ^.^