Re: Cocoa and messages to nil, revisited
Re: Cocoa and messages to nil, revisited
- Subject: Re: Cocoa and messages to nil, revisited
- From: Wade Tregaskis <email@hidden>
- Date: Wed, 8 Aug 2007 22:48:14 -0700
The truly paranoid would do something like:
id cantbenull(id in)
{
if (in == nil) @throw blah blah...
}
[cantbenull(this) uses:[(cantbenull(that) which:...
you get the picture. Clearly thats a ludicrous style, but I can
guarantee
its *never* surprised by nil objects.
As I matter of opinion and personal style, I would argue that
throwing an exception says exactly that you were surprised; if you
were in any way anticipating a condition, you'd check for it and
handle it, not just barf and goto up the stack somewhere.
Yes, maybe I've been bitten by some poor use of exceptions before... :)
Wade
_______________________________________________
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