Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by breadwinner on Thursday July 13, 2023 @10:25PM
(#36718731)
If someone added an extra parameter to a function you're calling, when would you want to be alerted about it? At compile time? Or when you rerun all the tests?
[ Parent
| on HN ]
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by mrkeen on Friday July 14, 2023 @02:26AM
(#36720161)
> If so can you now understand why you would want to be alerted about a new exception getting thrown at compile-time as well?
The library code can already throw anything. OutOfHeap, over/underflow, div0, stackoverflow, threadinterrupted. The caller already knows the function can throw, and documenting one more flavour of throw doesn't tell the caller anything.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by twelve40 on Friday July 14, 2023 @02:32AM
(#36720192)
> documenting one more flavour of throw doesn't tell the caller anything
but it does, in cases when there are errors that can or should be retried. Like a whitelist of documented cases where recovery and retry are possible, and of course all this infinite runtime stuff that can happen unexpectedly, for which there is no immediate solution.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by taeric on Friday July 14, 2023 @08:50AM
(#36723210)
I'd like to think that, as an industry, we would move to libraries being foundational code, such that they don't change in fundamental ways. If a parameter is added, it should be done in a backwards compatible way, such that I don't have to know about it. The old behavior would continue to work.
As such, any breakage from calling would be, by definition, a bug. And no, we have not found a way to prevent bugs.