• 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: [ANN] Cocoa Style for ObjC: 1 and 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ANN] Cocoa Style for ObjC: 1 and 2


  • Subject: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • From: Scott Stevenson <email@hidden>
  • Date: Wed, 27 Oct 2004 16:12:55 -0700


On Oct 27, 2004, at 2:13 PM, Ken Ferry wrote:

Does not saying
[NSFontManager sharedFontManager]
feel like you're repeating yourself?

To some degree, but I think the point is that the method should always describe what's being returned. One of the points that the tutorial makes is that Cocoa sacrifices brevity for clarity.


In my own code I always use +[Class sharedInstance]

To me saying "instance" more even more redundant. :)


Makes it easier to remember the method name too. For example, Apple's way you need to
remember that the method is

+[NSHTTPCookieStorage sharedCookieStorage]

and not

+[NSHTTPCookieStorage sharedHTTPCookieStorage]

I'm not sure this matters as much as with Xcode autocomplete. Granted, you could be using an editor that doesn't do this.


- Scott

--
http://treehouseideas.com/
http://theobroma.treehouseideas.com/ [blog]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: [ANN] Cocoa Style for ObjC: 1 and 2
      • From: Evan Schoenberg <email@hidden>
    • Re: [ANN] Cocoa Style for ObjC: 1 and 2
      • From: Ken Ferry <email@hidden>
References: 
 >[ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Ken Ferry <email@hidden>)

  • Prev by Date: Re: Saving image as JPG, GIF, PNG, etc.
  • Next by Date: Re: Populate a NSPopupButton with ascii
  • Previous by thread: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Next by thread: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Index(es):
    • Date
    • Thread