Favored Language for Network Enabled Apps.
dave at thesmithfam.org
Mon Oct 29 15:18:09 MDT 2007
Jonathan Ellis wrote:
> Probably because there usually really isn't anything useful you can
> _do_ in such cases. If my wireless goes down mid-transfer, there's
> not a whole lot the app can do besides put up a "sorry, you're hosed"
> dialog. So having the compiler make me add "throws
> YouAreHosedException" is just more boilerplate.
I liked them because the compiler would tell me what errors I had to
handle, so I could figure it out without having to read some (possibly
outdated) document listing return codes. Then, if a library author added
a new error condition that I needed to handle, the compiler would force
me to do it. The fact that most developers don't handle them *well*
doesn't mean that the concept is flawed.
I agree that there are flagrant misuses of checked exceptions where you
have to catch a dozen exceptions just to open an SQL database
connection, for example, but it's good to know that the compiler can at
least tell you if you're not catching them when you should be.
More information about the PLUG