Re: @try @catch
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
References: | |
| >@try @catch (From: Georg Seifert <email@hidden>) |