• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [newb] Allowing error-prone code line to persist in app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >[newb] Allowing error-prone code line to persist in app (From: Chris Paveglio <email@hidden>)

  • Prev by Date: Re: [newb] Allowing error-prone code line to persist in app
  • Next by Date: Re: [newb] Allowing error-prone code line to persist in app
  • Previous by thread: Re: [newb] Allowing error-prone code line to persist in app
  • Next by thread: Re: [newb] Allowing error-prone code line to persist in app
  • Index(es):
    • Date
    • Thread