gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: [OT] Java is fun!


From: Mark A. Flacy
Subject: Re: [Gnu-arch-users] Re: [OT] Java is fun!
Date: Fri, 24 Oct 2003 04:29:26 -0500

>>>>> "Tom" == Tom Lord <address@hidden> writes:
Tom> 
Tom> 2) In C, we fully expect that linked in code has pretty much free
Tom>    reign and that the code it's linked into can not control what it
Tom>    does.
Tom> 
Tom>    In Java, we have the opposite expectation.

You'll have to explain how you come to that conclusion.

Tom> 
Tom>    Now to be sure, it is still _possible_ to write Java code which is
Tom>    robust against the exception-checking hole, but to do so means that
Tom>    you have to `catch (Throwable ...)' whenever you call outside your
Tom>    package.   If you then want to rethrow some subset of "unexpected" 
Tom>    exceptions, you have to use constructs other than `catch' to
Tom>    discriminate among the exception types.   Practices like that have 
Tom>    been explicitly denounced by Java fans on the list who say that
Tom>    they are poor practice in Java.

You really should reconsider your use of the phrase "Java fans"; I may or
may not be a fan of the language, but I am certainly more experienced in
its useage than you are.

Package also has a specific meaning in Java, which I do not believe matches
your useage here. 

There is almost never a reason to catch Throwable instead of Exception.
Throwable contains Error and Exception.  Errors are almost always fatal or
otherwise not susceptible to repair for most applications.  Exception
includes RuntimeException, which is the root class of those exceptions that
aren't mentioned in a throws clause.

You haven't come up with a good reason why this "major error" is a recipe
for disaster.

I'm also unclear why you would wish to rethrow only a subset of
"unexpected" exceptions.  


-- 
 Mark A. Flacy
 Any opinions expressed above are my own.  Any facts expressed above
 are, ummm, facts.
"The nice thing about standards is that there are so many of them to
 choose from."  -- Andrew S. Tanenbaum





reply via email to

[Prev in Thread] Current Thread [Next in Thread]