• 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: Any good advice for naming parameters of init methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any good advice for naming parameters of init methods?


  • Subject: Re: Any good advice for naming parameters of init methods?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 10 Jul 2008 08:20:32 -0700


On 10 Jul '08, at 8:09 AM, an0 wrote:

I like the idea of adding prefix to my ivars, and in fact, all my C++
code use _ivars.

Good! I highly recommend that in Obj-C too. (I use "_" like you.)

However, I like the "declared properties" feature of Objective-C 2.0,
and the good feeling will be impaired if I have to  explicitly bind
ivars to these declared properties like this:
@synthesize url = iUrl, title = iTitle, tags = iTags, note = iNote,
time = iTime, count = iCount.

*shrug* I don't find it much of a problem. It's just a few more characters to type in the .m file for each property, and it has no effect on clients of that class. As I said, I highly recommend using ivar prefixes.


—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >Any good advice for naming parameters of init methods? (From: an0 <email@hidden>)
 >Re: Any good advice for naming parameters of init methods? (From: Graham Cox <email@hidden>)
 >Re: Any good advice for naming parameters of init methods? (From: an0 <email@hidden>)

  • Prev by Date: Re: Why can't I name a property `tag'?
  • Next by Date: Re: Any good advice for naming parameters of init methods?
  • Previous by thread: Re: Any good advice for naming parameters of init methods?
  • Next by thread: Re: Any good advice for naming parameters of init methods?
  • Index(es):
    • Date
    • Thread