On 05/11/2010 18:52, Walter Bright wrote:

I think you misunderstand why checked exceptions are such a bad idea.
It's not just that they are inconvenient and annoying. They decrease
security by *hiding* bugs. That is the opposite of what you'd want in a
high security language.

http://www.mindview.net/Etc/Discussions/CheckedExceptions



Just to clarify: Checked Exceptions are not a source of bugs per se. What is a source of bugs is catch-hiding an exception temporarily and then forgetting to change the code later (that's the case Bruce mentions in the article). But with discipline you can avoid this: just don't catch-hide exceptions. One never catch-hides exceptions by mistake, it is always conscious (unlike other bugs like off-by-ones, logic errors, etc.). For example in Java I *always* wrap exceptions I don't care about in a RuntimeException, (using the adapter Bruce presented in that article, actually). Is it annoying and/or unnecessary? Well, I'm not making a statement about that, just that it will only actually cause bugs if you are lazy.

--
Bruno Medeiros - Software Engineer

Reply via email to