Exception transparency - lone throws (no checked exceptions)
Alessio Stalla
alessiostalla at gmail.com
Fri Jun 11 11:09:40 PDT 2010
On Fri, Jun 11, 2010 at 7:59 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> I think this is an interesting exploration of the design space, so I
> appreciate your posting it here. However, as several other posters here have
> suggested, this isn't really "exception transparency" as much as it is a
> limited form of "turn off checked exceptions." (This is a solution to the
> problem of exception transparency much as arson is a solution to the problem
> of cockroaches.)
I don't agree. If there were no checked exceptions, this whole
discussion would not have happened - unchecked exceptions are already
transparent in Java. Checked exceptions are not, and we want them to
be. How? Making them behave like unchecked ones in certain
circumstances seems to me a reasonable solution to that very problem.
Not the only possible solution of course, but it's worth to seriously
consider it imho.
> Besides the points raised here, I could easily imagine a world where
> developers who don't like checked exception just decorated every method with
> "throws". I don't know if that is the intent of the proposal or simply a
> side-effect, but it is (in our view) some pretty serious collateral damage.
> (People are free to argue that they don't like checked exceptions and they
> should be abolished. But not here; there are plenty of other fora where such
> discussions can happen.)
And I can easily imagine a world where developers who don't like
checked exceptions just rewrap them all in unchecked ones. Actually I
don't even need to imagine it, it's already real. Are you arguing that
since adding "throws" is easier than rewrapping exceptions, people
will use it more?
Alessio
More information about the lambda-dev
mailing list