I have no doubt there is huge amount of people who love the exceptions, and 
I agree with you 
that is precisely this crowd that pushed this agenda forward.

But I found following true, anything that can fail will fail. E.g. any type 
of IO operation.
It's not a question of if but when.

What that means I have a problem when people think IO Error is an 
exceptional state of some kind.
It is not, it's just valid return value of the given IO operation, if I 
think of it as such I write code that is more reliable and testable.

As for panic/recover - given the above when would I really want to panic? 
If I treat my errors as first class citizens, I don't ever need to panic.
And for the record I myself have on few occasions reached for panic (this 
will never happen type of thinking) - and I found myself going back and 
replace it
with proper error handling every single time. So now I just know better.

As for the argument that it is possible to use try/catch type of error 
handling  successfully.
I say I don't doubt it - I just never had the pleasure to work with (or 
after) anyone that was able to do that.
And I include my own try/catch code in that group.


On Sunday, July 7, 2019 at 5:37:38 AM UTC, Lucio wrote:
>
> On 7/6/19, Jakub Labath <jla...@labath.ca <javascript:>> wrote: 
> > "And yes go does have panic/recover - but I never use them for the same 
> reasons I 
> > dislike exceptions. It's just really hard to reason about such jumps in 
> logic especially 
> > in massively concurrent programs that go allows us to write." 
>
> I agree with everything else you state, except the above. 
>
> Those who are comfortable with try/catch and similar should seek their 
> comfort zone in panic/recover and teach some of us why they find them 
> useful. 
>
> Note that I am not one of those. But a lot of the needling that led to 
> "try - the function" almost certainly originates from those quarters 
> and only a little social engineering in the form of great 
> documentation may be needed to put that dragon back to sleep. I vote 
> we encourage that. 
>
> Lucio. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4052c175-b34e-476b-8e31-90695bed924e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to