• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C question for you old guys ;-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: C question for you old guys ;-)
      • From: Hsu <email@hidden>
References: 
 >Re: C question for you old guys ;-) (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Putting color wells in a table.
  • Next by Date: Getting coverart from a track via AppleScript
  • Previous by thread: Re: C question for you old guys ;-)
  • Next by thread: Re: C question for you old guys ;-)
  • Index(es):
    • Date
    • Thread