News for hackers. Stuff that matters.
Re:Errors – Gotta Catch 'Em All by kaoD on Thursday April 04, 2019 @11:57AM (#19573829)
> All you need to know is what exceptions you can handle

Ah, so that's "all" I need to know!

And that's what typed errors do.

Re:Errors – Gotta Catch 'Em All by wvenable on Thursday April 04, 2019 @12:26PM (#19574177)
You might only be able to handle restartable network exceptions. In my case, that might be a single base type. So I put a try block in where I can handle that exception (where my network code starts) and I'm done.

Do I need to check the return type of the thousands of methods that might make up that operation? Nope. Typed errors make me do a lot of work passing stuff around and declaring types that literally don't matter. If somebody adds a new method that does another network call, I'm still good and I didn't have to do anything.

Re:Errors – Gotta Catch 'Em All by kaoD on Thursday April 04, 2019 @12:33PM (#19574242)
You like implicit. I don't.

I don't think we can discuss deeper than that.

Re:Errors – Gotta Catch 'Em All by wvenable on Thursday April 04, 2019 @12:38PM (#19574301)
Actually, for the most part I don't like implicit. But I also like encapsulation and polymorphism and you can't have those things if you are exposing implementation details all over the place.

The other thing I don't like is pointless boilerplate code.

But I do like strongly-typed languages and originally I thought I'd like checked exceptions before realizing just how wrong that concept is. It's not hard to see the parallels between checked exceptions and error returns.