By bloid
via blog.thinkrelevance.com
Published: Aug 05 2008 / 01:28
I have chosen four languages which together represent "Java.next": Clojure, Groovy, JRuby, and Scala. At first glance, these languages are wildly different. Clojure is a Lisp. Groovy is the "almost Java" choice. JRuby has the beauty of Ruby, and the mindshare of Rails. Scala, unlike the others, brings the notion that we need more static typing.
Comments
Jacek replied ago:
Checked exceptions are the best part of Java. I wrote a whole system in C# without checked exceptions and it was a nightmare once you start dealing with interfaces and multiple implementations. Checked exceptions are NOT a failed experiment.
raveman replied ago:
it is failed experiment. the problem with checked exception is that you have to deal with them, i never had a need to deal with SQLException. it should be some kind of warning and easier way to ignore exceptions that you not care about.if you dont think "what will happen if file wont exist" you should not deal with FileNotFoundException. If you think "what might go wrong that i should deal with" - you can find unchecked exception and deal with it.
andrewm replied ago:
as with jacek, i also find a mixture of checked and unchecked exceptions to be very useful in my work. perhaps as you (raveman) imply, the way to go is to retain checked exceptions and then by default methods do not have to check exceptions (preventing the "throws" clauses from propagating through the code base). then, a method could be marked as "checked" if it wanted to be explicit about catching checked exceptions.
E.g.
if method 1 was:
void method1() throws CheckedException {...}
and method2 by default is "unchecked" then it can call method1() without declaring that it may throw something:
void method2() { method1();...}
but if we wanted to make sure we got all checked exceptions at some point we could do:
void checked method3() { try { method2(); } catch (CheckedException e){...}}
Andrew
Jacek replied ago:
You've never had to deal with a SQL exception and properly roll things back in an open transaction? Nice.
Voters For This Link (11)
Voters Against This Link (2)