Hi Egon,

the problem with checked exceptions is, that the mostly occur on a very low 
level, meaning in IO operations.
In my usage of CDK when creating molecules from file or database. The thing is 
that it is not possible to do any meaningful exception handling at such a 
level. Not really a problem but now the method has to have a "throws clause". 
And if that method is part of an interface the method defined in the interface 
needs the throws clause.
Not all implementations of that interface actually throw that exception. -> it 
clutters your interfaces.

Going runtime-exceptions only of course requires that it is documented for each 
method which exceptions it can throw. Then the developer using it knows exactly 
what to expect just like with a checked exception but without cluttering 
interfaces (as example).

The only real need for a checked exception is bad documentation. Because 
checked exceptions are "self-documenting".

I'm not an expert but I my own limited experience convinced me of checked 
exceptions being at best useless (IMHO they actually make you work around them, 
time consuming and other downsides). 

Thomas


> From: egon.willigha...@gmail.com
> Date: Tue, 12 Jul 2011 08:56:08 +0200
> Subject: Re: [Cdk-user] Exceptions again: three designs. What will we use in 
> the next CDK series (1.6 or 2.0)?
> To: beginn...@hotmail.de
> CC: cdk-de...@lists.sf.net; cdk-u...@lists.sf.net
> 
> On Thu, Jul 7, 2011 at 3:17 PM, Thomas Strunz <beginn...@hotmail.de> wrote:
> > IMHO it must get more granular and also I really don't like the fact that
> > CDKException is a checked exception. In most of the cases it is just
> > annoying and useless.
> 
> I think I disagree. You can get any Runtime exception and never know
> what to expect.
> 
> Invalid input is very common here, and your software needs to recover
> from that, and differently from other situations. I think a Runtime
> exception should only happen when something *unexpected* happened,
> like OutOfMemory or so...
> 
> > I know, endless debate and maybe you have had it several times but for me as
> > user as it is now: annoying like hell. Just like pure JDBC.
> >
> > other frameworks that use Runtime exceptions are IMHO a lot more friendlier
> > to work with.
> 
> Why do you find it annoying? And useless? Why do you find Runtime
> exceptions from user friendly?
> 
> Egon
> 
> -- 
> Dr E.L. Willighagen
> Postdoctoral Researcher
> Institutet för miljömedicin
> Karolinska Institutet (http://ki.se/imm)
> Homepage: http://egonw.github.com/
> LinkedIn: http://se.linkedin.com/in/egonw
> Blog: http://chem-bla-ics.blogspot.com/
> PubList: http://www.citeulike.org/user/egonw/tag/papers
                                          
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to