• 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: Style Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Style Question


  • Subject: Re: Style Question
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 27 Jun 2008 22:13:54 -0700


On 27 Jun '08, at 9:44 PM, Alex Wait wrote:

if I have a member, let's say a NSString, called FirstName...
would the setter still be setFirstName?

Yes. But you shouldn't name the property "FirstName". Property and method (and instance variable) names should be lowercased. There are some exceptions made when the name begins with an acronym, most commonly "URL", that needs to remain uppercase for legibility.


Honestly, no one reading your code is going to care whether you put braces at the end of a line or on a new line. But naming conventions are important and can help or confuse other people (or yourself, a year later) trying to understand it.

—Jens_______________________________________________

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


  • Follow-Ups:
    • Re: Style Question
      • From: "Alex Wait" <email@hidden>
References: 
 >Style Question (From: "Alex Wait" <email@hidden>)
 >Re: Style Question (From: "Shawn Erickson" <email@hidden>)
 >Re: Style Question (From: "Alex Wait" <email@hidden>)

  • Prev by Date: Re: NSString uppercaseString
  • Next by Date: Re: Style Question
  • Previous by thread: Re: Style Question
  • Next by thread: Re: Style Question
  • Index(es):
    • Date
    • Thread