Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Dan Sugalski <email@hidden>
- Date: Mon, 9 Jun 2003 08:43:04 -0400
At 11:30 AM +0200 6/9/03, Marcel Weiher wrote:
I guess I should have been a little more explicit. I wouldn't do
either of the above, but rather:
if ( spriteInfo == NULL ) {
return nil;
}
Having been bitten by C's block issues before, I do that as well, but
I try and take it one step further and do:
if ( NULL == spriteInfo ) {
return nil;
}
putting the constant on the left-hand side of the equality test. It
catches the times when I miss a = in the test--"NULL = foo" throws a
compile-time error, "foo = NULL" leads to a bughunt session.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
email@hidden have teddy bears and even
teddy bears get drunk
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.