Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...
DerekParnell said...

I regard exceptions as those things that originate from outside the control of an application and that cannot be effectively anticipated by it. That's why the application should terminate, possibly after doing some damage control/mitigation first.

That might be a better definition of exception, but I don't get that the only response to things beyond your control is to die.

My argument goes something like this ...
Your application was trying to do something useful. Something unanticipated and outside of your program's control caused things to stuff up. So what is you program going to do so it can succeed in doing that useful thing? Now I'm not talking about logic errors in your code, or invalid data being presented to your program, or error codes that can be returned by functions you call. I'm talking about exceptions - rare events that for the most part you can safely avoid writing special code to handle.

The Euphoria run-time component has many potential calls to RTFatal() and the vast majority would be triggered by bad data or bad coding. Things that appropriate testing should be discovering. They occur when the application is demonstrably doing the wrong thing and the code needs to be corrected. Failing the application is not a bad course of action with these.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu