Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Jeff Harrell <email@hidden>
- Date: Wed, 11 Jun 2003 14:48:59 -0500
On Wednesday, June 11, 2003, at 10:48 AM, Andy Lee wrote:
Out of curiosity -- do you also use...
#define not !
I have my own personal idiom for dealing with this. I can't stand "if
not x," so in situations where it's unavoidable I do this:
if (something) {
// TSILB
} else {
useful code
}
TSILB, of course, stands for "this space intentionally left blank."
When I'm designing an interface and need to include an accessor that
returns a boolean value, I always use two functions, one of the
positive and one of the negative form. So I end up with
- (BOOL)isSomething
- (BOOL)isNotSomething
That way I don't have to fiddle with if (![something isSomething]).
But these are just my own personal conventions that I use for myself.
Everybody's got their own way of dealing with the insidious !.
--
email@hidden
http://homepage.mac.com/jharrell
_______________________________________________
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.