Article

From:
To:
Greg Lorriman
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes

Greg

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

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.
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?
Joe
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Thu, 14 Nov 2024 17:28:24 UTC
Copyright © 2009-2024
HREF Tools Corp.