The way checked exceptions work means that users who _do_ care about exceptions will be forced to declare or handle them. But the users who don't... they get to call `foo` with zero ceremony, just as the could before. But the library designer doesn't have to decide.
-
-
Show this thread
-
And what if you want to write a "let-it-fail" prototype but might want to make it safe later? The best part is that most of the code wouldn't change: no need to switch to for-comprehension style. Either you wrap the expression in try/catch, or declare its return type as throwing.
Show this thread
End of conversation
New conversation -
-
-
interesting take, contrary to many opinions I've heard. Thanks for making it
-
I'd guess the other opinions are based on experience with checked exceptions in other languages, which Scala 3's approach acknowledges wholeheartedly, and attempts to fix. Or, I might speculate, from an overattachment to a monadic style... ;)
End of conversation
New conversation -
-
-
Didn't you have a library for letting users choose?
-
When I saw him present it, I thought it was one of the coolest things ever
- Show replies
New conversation -
-
-
One place when I will absolutely appreciate checked exceptions in Scala is interaction with Java libraries.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I have mixed feelings about this capability. Most of the time when something fails in a system, I just want to know if it's retryable or not. Having a complex exception domain has never really helped in my experience.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Wasn't this checked exception thing meant as a first test balloon for some kind of language-integrated effect system?
-
Yes, but that's maybe underselling it... it has a variety of other possibilities, though this one seems like the most tangible one to me.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.