• 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: "John C. Randolph" <email@hidden>
  • Date: Mon, 9 Jun 2003 13:38:18 -0700

On Monday, June 9, 2003, at 12:52 PM, Eric Wang wrote:

on 6/9/03 12:49 PM, John C. Randolph at email@hidden wrote:

#define is ==

if (spriteInfo is NULL)

.. ever since I started doing this, I've never assigned when I meant to
compare.

-jcr

Thanks, that's a great tip! Much more readable than putting the constant on
the left-hand side of the equality test.

IMHO, it works even better when the expression is something like

if ([[self controlView] selectedObject] is self)
[self drawSelectionIndicators];

-jcr

John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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: Karl Goiser <email@hidden>
References: 
 >Re: C question for you old guys ;-) (From: Eric Wang <email@hidden>)

  • Prev by Date: Re: [OT] Where to get short sounds?
  • Next by Date: Re: C question for you old guys ;-)
  • Previous by thread: Re: C question for you old guys ;-)
  • Next by thread: Re: C question for you old guys ;-)
  • Index(es):
    • Date
    • Thread