Retiring Checked Exceptions Was: Throwing Functions
Brian Goetz
brian.goetz at oracle.com
Mon Nov 14 17:54:55 UTC 2022
On 11/14/2022 11:33 AM, Archie Cobbs wrote:
>
> I like checked exceptions also.
I think the replies here have proven my point.
It's an easy opinion to say "checked exceptions were a failed
experiment" -- likely too-easy an opinion -- but people have a right to
their opinions.
But even if one conceded this point, that doesn't mean "so back it out"
is a smart move. People have built up billions of lines of code based
on assumptions about how exceptions work; pulling the rug out from under
them has a real and pervasive cost. Banging the "failed experiment"
drum incorrectly assumes those costs away.
But more importantly, the "failed experiment" crowd seems to take it as
an article of faith that everyone agrees with them, because there are
not protest rallies in the street chanting "Save Checked Exceptions".
But it did not take long to elicit a few well-reasoned "I prefer the
status quo" opinions. There are plenty of people who think the status
quo is fine, and that a radical change would be worse, they're just not
making a big deal about it, instead they're getting work done.
Yes, it is unfortunate that some early JDK APIs used checked exceptions
poorly, before we really understood what they were good and bad for.
And yes, its unfortunate that they have inconvenient interactions with
other language features, such as lambdas.
Another aspect of the unhelpfulness of the "let's just kill them"
argument is that Nathan's modest request gets lost in the shuffle.
Nathan came with a reasonable request -- "can we have a few more
functional interfaces" -- and instead, someone used it as an excuse to
start a holy war and reasonable mitigations easily get lost along the way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20221114/b0166daa/attachment.htm>
More information about the amber-dev
mailing list