• 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: Graham Cox <email@hidden>
  • Date: Mon, 7 Apr 2008 15:41:41 +1000

This is a very silly remark. Why would they laugh? Even if they did, do I care? No. I usually use mSomeVarName or m_someVarName in my projects for ivars. I like the 'm', it tells me it's a member. I also use s_ for statics and g_ for globals. I come from C++ to Cocoa, so what? Whatever convention you use is not important as long as it's reasonably consistent and helps you be productive. Telling ivars apart from other variables by the use of some naming convention is a very good idea, whether you prefix it with 'm' or whatever is irrelevant.

G.


On 4 Apr 2008, at 4:58 am, Rob Napier wrote:
2. Leading "m" makes you look like a C++ programmer and other ObjC
programmers will laugh at you. You can take that for what it's worth, but
it's worth keeping in mind if you're going to work on large projects with
other programmers. "Other ObjC programmers will laugh at you" seems to be a
common mechanism for keeping large projects sane. Java guys use their
compiler. We use peer pressure. Which you think is a better way to enforce
good practice will determine whether you are happier as a Java or ObjC
programmer.

_______________________________________________

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>)

  • Prev by Date: Re: activate my application while dragging on other application window
  • Next by Date: Re: Using existing SQLite database with core data?
  • Previous by thread: Re: Objective-C Instance Variable Names
  • Next by thread: Re: Objective-C Instance Variable Names
  • Index(es):
    • Date
    • Thread