4 ms·
> 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.
by kaoD 8y ago
> 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.
- wvenable 8y agoYou 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.
- kaoD 8y agoYou like implicit. I don't. I don't think we can discuss deeper than that.
- wvenable 8y agoActually, 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.
- deleted 8y ago[deleted]