Bharath Gali's Library tagged → View Popular
S'mythology: Evolving Java - Increasing Demand To Remove Checked Exceptions
-
Naturally if you have existing code depending on a method signature (which includes exceptions) you have to catch any undeclared checked exceptions and (optionally) throw a declared exception or an unchecked exception.
The use of "throws Exception" in a method signature is a coding anti-pattern, used only if you want to give up all responsibility for handling errors. I certainly don't recommend it and similary I only recommend the "notry" keyword as a way to facilitate developers who want to opt out of dealing with errors. For simple non-critical programs this "philosophy" may be acceptable and I believe the Java language should support it.
Java theory and practice: The exceptions debate
-
Checked exceptions represent useful information about the operation of a legally specified request that the caller may have had no control over and that the caller needs to be informed about -- for example, the file system is now full, or the remote end has closed the connection, or the access privileges don't allow this action.
Selected Tags
Related Tags
Sponsored Links
Ads by Google
Top Contributors
Groups interested in Programm...
Diigo is about better ways to research, share and collaborate on information. Learn more »
Join Diigo
