Article

From:
To:
J. M. De Moor
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes


> > Absolutely not! I am saying that it is unreasonable for MS Word to do
> > anything other than abort if the user provides a false path in the open
> > dialog. What is the programmer supposed to do?
>
> PMFJI...but I agree with Kristofer.  In the case you describe, MS provides
> an informational message saying that the file path is invalid and then
> offers a suggestion to correct the problem.  This type of action does not
> require exception handling to accomplish.  When you acknowledge the message
> with the OK button, the program takes you right to where you left off to try
> again.

see my reply to Kristofer.

> I don't think that the need for user intervention automatically means
> exception handling.  For one thing, I have had to clean up code where the
> developer passes the cryptic exception message up to the user, who then has
> to call for tech support...and no one wins.

That the message is cryptic doesn't mean that rasing an exception was the
wrong thing to do. If it hadn;t been cryptic then perhaps tech support
wouldn't have been called.

> Also, I think there are too many cases where info or error message explains
> to the user exactly what to do, where instead the program could have done
> that task instead.  Even in the example above, if you give a program an
> invalid path, did the user have the opportunity to input a default path so
> that this can be used?  Can the MRU be more helpful?

I don;t think either of your suggestions are reasonable for the example I
gave. Perhaps in another situation but then that would only be to say that
invalid paths are not always a reason for raising exceptions, which I'm not
denying.

Greg
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Tue, 07 Feb 2023 05:41:38 UTC
Copyright © 2009-2023
HREF Tools Corp.