• 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: @try @catch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @try @catch


  • Subject: Re: @try @catch
  • From: Andrew Farmer <email@hidden>
  • Date: Thu, 14 Aug 2008 17:34:15 -0700

On 14 Aug 08, at 03:58, Georg Seifert wrote:
is it recommended to use @try .. @catch blocks as flow control like it is used in Python. They say explicitly to use it rather than do a lot of test before just try if it works to look after it only if it fails.

Python has been optimized to handle exceptions quickly, so it's often faster to catch exceptions than to check for exceptional situations in Python code. Objective-C has not been similarly optimized*, so checking for errors before attempting operations will be much faster than catching exceptions unless the exceptions are exceedingly rare.


*: Or, more accurately, the overhead of setting up exceptions is much higher compared to the overhead of checking for situations that would trigger them.
_______________________________________________


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


  • Follow-Ups:
    • Re: @try @catch
      • From: j o a r <email@hidden>
References: 
 >@try @catch (From: Georg Seifert <email@hidden>)

  • Prev by Date: Re: Making a bound view re-read its value
  • Next by Date: Re: crashing MacOs application when running a build file
  • Previous by thread: Re: @try @catch
  • Next by thread: Re: @try @catch
  • Index(es):
    • Date
    • Thread