.NET has a broken Exception model

  • Thread starter Thread starter cody
  • Start date Start date
Are you thinking of something like checked exceptions in Java?

I've said many times that this is not the way to do it. Checked exceptions
were a noble but failed experiment.
 
Dave said:
Even these can change, and they probably will. About the only one I can
think of that would always be fatal is ExecutionEngineException as that
indicates that the runtime itself is corrupt. But even these distinctions
are not all that useful because there is high liklihood that if the runtime
itself detected its own internal corruption, as it likely in one of these
three exceptions, it would probably halt its normal exception propagation
and simply terminate the app, so you really couldn't catch it anyway.
there

there is a double.TryParse, and one of its arguments let's you specify its
type (int, float, etc).

Yep, that's what I meant. There is a double TryParse, but not one for Int32,
DateTime etc. As such, the OP is having to use exceptions for control-flow
which isn't really exceptional. I think that's the problem, rather than the
exception model.

cf is short for 'confer', which apparently is Latin for compare.

Stu
 
Are you thinking of something like checked exceptions in Java?
I've said many times that this is not the way to do it. Checked exceptions
were a noble but failed experiment.


So how do you imagine such an error/exception-contract?
 
Back
Top