Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message
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.

Imagine I've got a program that generates a .wav file as output. I find that someone's written a library that generates .wav files from a sequence.

Hurrah! Only there's the possibility that perhaps the developer didn't do adequate range checking. If we use your definition of exceptions, I've got a couple options:

  1. I can read through the library, making sure that it traps all possible errors, or
  2. I can write my own library, just in case, or
  3. I can choose not to use Euphoria

While in theory I can anticipate range errors, this is tricky in practice.

I'd rather be using a language that allows me to gracefully recover from exceptions, than one that crashes.

As pointed out, if you chose not to use that feature... you still get an immediate failure.

- David

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

Search



Quick Links

User menu

Not signed in.

Misc Menu