Re: self = [super init], nil?
Re: self = [super init], nil?
- Subject: Re: self = [super init], nil?
- From: Todd Heberlein <email@hidden>
- Date: Mon, 10 May 2010 13:43:44 -0700
On May 10, 2010, at 1:24 PM, David Duncan wrote:
>> By the way, I concur with Thomas Davie: treating a pointer as a Boolean makes me nervous.
>
> I don't see any reason not to make the comparison explicit if you desire. I do it all the time :).
This has been part of C since the beginning -- 0 or NULL is false, anything else is true. However, I always like to make the comparison explicit to improve readability. The only problem is that from time to time I enter a single = instead of a double ==, so it does ever so slightly increase the risk of a bug.
Todd
_______________________________________________
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