Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by wvenable on Friday July 14, 2023 @01:57PM
(#36727563)
> If it wouldn’t, an exception of that kind could bubble up at a place you didn’t expect.
You should always be able to handle an unknown exception. Sure you can't do much about it, but it shouldn't be a big deal. An exception only occurs if the code can't continue as expected.
Libraries are supposed to be a point of abstraction. They should be allowed to change their implementation fundamentally as long as they continue to respect the same interface. Exceptions should not be part of the interface explicitly because are they implementation-detail related.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by nradov on Friday July 14, 2023 @07:27PM
(#36731341)
If you don't control the code where the superclass or interface is defined then you're stuck. You can't change that code even if it would be only a tiny edit. Checked exceptions are absolutely not a "feature".
That’s a feature, not a bug. If it wouldn’t, an exception of that kind could bubble up at a place you didn’t expect.
Also, it doesn’t require that many changes, it only has to be changed up to the point where you intend handling it.
I don’t see how rust would be immune to that.
Though it is true that polymorphism with respect to checked exceptions would be great. The new generation of languages might have that (e.g. Koka)