Hi Sulev,
I would go even further and remove checked exceptions completely. The
documentation should state which exceptions are thrown in a method an hence the
developer knows and can decide on his own if he wants to deal with it. If he
doesn't want to deal with it, he will do as you said which often makes the
situation worse. It's like treating someone as a child and the reaction to that
is mostly not very friendly.
It's no wonder a lot of well known frameworks don't use checked exceptions at
all in facts the wrap them in runtime exceptions.
So IMHO:
1. only runtimeexceptions (wrap checked excpetions eg IOExcpetions)
2. create more specific exceptions that ca be selectivley dealt with in
try..catch
I often get CDKException thrown when typing Atoms. And in that case my input is
correct but CDK does not know how to deal with it. pretty annoying.
->UnknownAtomTypeException maybe?
Best Regards,
Thomas
> Date: Wed, 6 Jul 2011 16:08:39 +0300
> From: s...@chem.ut.ee
> To: vincent.le-guill...@univ-orleans.fr
> CC: cdk-user@lists.sourceforge.net
> Subject: Re: [Cdk-user] [Cdk-devel] Exceptions again: three designs. What
> will we use in the next CDK series (1.6 or 2.0)?
>
> Hello,
>
> On Jul 06, Vincent Le Guilloux wrote:
> > I would also roughly go to the Nina's solution, with a strong
> > agreement with Rajarshi. Just a few additional word to enrich this
> > interesting discussion:
>
> I also like that suggestion.
>
>
> > Too much exceptions handling / types usually gives verbose code (JAVA
> > is verbose enough hu... ;)), endless try/catch at every level of the
> > code, and bad performances.
>
> This reminds me the old debate about checked versus unchecked exceptions.
> There is a good summary about this topic:
> http://www.ibm.com/developerworks/java/library/j-jtp05254/index.html
>
> One approach would be to have both checked and unchecked exceptions
> in the CDK API. Checked exceptions are used only for cases where the
> programmer has an obvios way for recovering the exceptional situation.
> The rest are runtime exceptions (could inherit from CdkRuntimeException).
> I've observed that checked exceptions in code are rarely handled, they
> are usually rethrown, logged, or swallowed.
>
> Best wishes,
> Sulev
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user