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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to