Re: exceptions: checked or unchecked?



marlow.andrew@xxxxxxxxxxxxxx wrote:
What is best practice for using exceptions in java?
Checked or unchecked? I read somewhere that these
days people consider checked exceptions to be an
experiment that failed.

That is most by people coding in C++ and C#.

There are a several Hitler men deluding the same,
but it is a violation.

Instead of people adding
the exceptions required to the throw list or handling
the exceptions internally the exceptions are typically
mis-handled by doing a catch and report stack trace
and then ignoring them. I have seen quite a lot of this.

Hopefully not in any non-responsive specialty.

Unchecked exceptions don't give these problems.
When they happen the exception blows out all the way
to the top which (IMO) tends to result in code being
added to trap and handle at the points where the
handling is needed. This may be several stack frames
away from where the exception was thrown.

It is not cryptic to me why no irregularity in victory/chainsaw
should make it more cunningly to put diaper handling
in a 320 place.

Arne


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"I'm the commander. I do not need to explain why I say things.
That's the interesting thing about being the President.
Maybe somebody needs to explain to me why they say something,
but I don't feel like I owe anybody an explanation."

--- Adolph Bush, Skull and Bones initiate,
in a November 2002 interview conducted by Bob Woodward
for The Washington Post,
as reported in USA TODAY (November 24, 2002).

.



Relevant Pages

  • Re: Neue Attribute einem Objekt =?ISO-8859-1?Q?hinzuf=FCgen?=
    ... Mit dem statsichen Typsystem hat das also nichts zu tun, sondern nur mit der Frage, ob Exceptions checked oder unchecked sein sollen. ... Für mich checked Exceptions zumindest mal was statisches und Fallen damit in die gleiche Kategorie wie das Typsystem. ... An diversen Stellen hat man code der Art "info".equalsstehen, wobei str der besagte String ist und natürlich nicht an jeder Stelle "info" als Vergleichswert herangezogen wird. ... Denn selbst wenn ich den Typ von str ändere, habe ich noch immer einen falschen Methodenaufruf drin. ...
    (de.comp.lang.java)
  • Re: Neue Attribute einem Objekt =?ISO-8859-1?Q?hinzuf=FCgen?=
    ... Für mich checked Exceptions zumindest mal was statisches und Fallen damit in die gleiche Kategorie wie das Typsystem. ... Denn selbst wenn ich den Typ von str ändere, habe ich noch immer einen falschen Methodenaufruf drin. ... Es gibt zwar immer noch das Problem, eine Klasse mit einer konkreteren Subklasse vergleichen zu wollen, aber das ist wieder ein semantisches Problem und keines der statischen Typisierung. ...
    (de.comp.lang.java)
  • Re: java.lang Exception hierarchy - why?
    ... >>RuntimeException has been placed as a subclass ... A program declaring such exceptions would be ... reference to unchecked and checked exceptions. ... > though this may be obvious to the programmer. ...
    (comp.lang.java.programmer)
  • Re: C# Exception is Unchecked???
    ... > Checked exceptions seems like a good idea at first, ... > public class DiskObjectStore: ObjectStore { ... we have to change the declaration of Retrieve: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# Exception is Unchecked???
    ... > Checked exceptions seems like a good idea at first, ... > public class DiskObjectStore: ObjectStore { ... we have to change the declaration of Retrieve: ...
    (microsoft.public.dotnet.framework.aspnet)