• 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: Objective-C Instance Variable Names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C Instance Variable Names


  • Subject: Re: Objective-C Instance Variable Names
  • From: glenn andreas <email@hidden>
  • Date: Thu, 3 Apr 2008 13:42:34 -0500


On Apr 3, 2008, at 1:29 PM, Hamish Allan wrote:

On Thu, Apr 3, 2008 at 7:08 PM, Robert Claeson <email@hidden > wrote:

C. Instance variables are usually named like "theName", "theAddress" or
something else that makes sense if there's the risk of mixup between ivars
and locals.

Myself I use "myName" for instance variables and "theName" for static variables. (I guess I'd probably use "globalName" if circumstances ever dictated.)


Here's another vote for using "myName" - after all, when you add an instance variable to a class in IB it is "myVariable". Plus if you ever directly try to access another objects ivars it looks wrong grammatically "someObject->myStuff" (using this guideline would make "its" a bad prefix for stuff not meant to be publicly visible).




Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Objective-C Instance Variable Names (From: Richard Somers <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: Jens Alfke <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: "Rob Napier" <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: Robert Claeson <email@hidden>)
 >Re: Objective-C Instance Variable Names (From: "Hamish Allan" <email@hidden>)

  • Prev by Date: NSPopupButton Cell in NSTableView
  • Next by Date: desktop access
  • Previous by thread: Re: Objective-C Instance Variable Names
  • Next by thread: Re: Objective-C Instance Variable Names
  • Index(es):
    • Date
    • Thread