development

Exceptions - not that new

January 7, 2004 16:32:47.785

Someone hand Michael Nascimento Santos a Smalltalk system, and show him how exceptions predate Java. Since he's just seeing that CheckedExceptions can be a problem, this could be enlightening:

I would like to point out, though, that it is very easy to speak about something that was conceived almost 10 years ago, after many years have passed and after using it and seeing others using it; it's a huge advantage the original creators couldn't have. James Gosling and all the other folks at Sun have made a great job designing Java and its API and, after nearly a decade, it is obvious there are things that could be better. I'll write more about other things - some far more critical than the way exceptions work - soon. Stay tuned!

The thing is, they weren't 'conceived' 10 years ago; they were badly copied....

Comments

Re: Exceptions - not that new

[Rich Demers] January 7, 2004 17:45:05.603

Comment on Exceptions - not that new by Rich Demers

Exception handling goes way back. My first exposure to it was the On-conditions of the PL/I language, designed in the mid '60s. A more definitive approach to exception handling was published in the mid '70s in the Communications of the ACM by a John Goodman (if I remember his name correctly). I haven't seen anything that goes beyond what was in that paper in any language -- certainly not java.

[iso] January 9, 2004 19:18:00.888

[isomer] January 9, 2004 19:19:18.884

the best way to invent history is to rewrite it (with appologies to alan kay)

Exceptions - not that new

[Michael Nascimento Santos] January 10, 2004 17:20:46.585

Hi, I never said exceptions were something new; it's the way Java addresses the problem that is. As far as I know - and I may be very wrong - , Smalltalk doesn't _force_ you to declare all your checked exceptions and catching or explicitly throwing them again. Note I may be mistaken, though. If I am, I'd be glad if someone could clarify it. When I mentioned "something that was conceived almost 10 years ago", I wasn't talking about exceptions; I was talking about Java. Your quote is somewhat misleading, though. I never said CheckedExceptions are a problem; they are _not_. They simply could be different, and maybe better; that's all. My suggestions simply are the result of years observing the way people are using Exceptions. Again, if I am wrong, I apologise and would be glad to get more information on this. Please, send me a message. My user is mister__m. The domain is dev.java.net. I am just trying to avoid getting spam :-D

Re: Exceptions - not that new

[James Robertson] January 10, 2004 20:17:16.296

Comment on Exceptions - not that new by James Robertson

Checked Exceptions are a problem, IMHO. Why? The place an exception is thrown is not necessarily the best place to catch it; what you end up with is chains of handlers looking for things they will simply pass on. Better to deal with the problem at the proper level, and have cleaner intermediate code that doesn't even mention it.

Re: Exceptions - not that new

[alan knight] January 10, 2004 20:31:24.296

Comment on Exceptions - not that new by alan knight

I believe that, good, bad, or whatever, having exceptions declared as part of the method signature and checked comes from Modula. Personally, I vote for "bad", but that's just me.

 Share Tweet This
-->