Re: [newb] Allowing error-prone code line to persist in app
Re: [newb] Allowing error-prone code line to persist in app
- Subject: Re: [newb] Allowing error-prone code line to persist in app
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 18 Aug 2009 10:24:04 -0600
On Aug 18, 2009, at 10:11 AM, Chris Paveglio wrote:
So SHOULD I write the check to make sure the data is valid or not?
Do you want your program to work correctly or not?
Or just let the function fail because its faster and has no lasting
impact? Is it OK if this line quietly (to the user) fails?
No. If your code is known to throw exceptions in certain situations,
then you should at least catch them before they halt execution of
something else and screw up your program's state. This is especially
important if your app never calls -[NSApplication run], or if your
code runs in another thread, since an uncaught exception in any thread
will cause your program to crash.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden