.NET has a broken Exception model

D

Dave

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.
 
S

Stu Smith

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
 
C

cody

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top