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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to