Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Drop "get" prefix on getters

#34

Classes like ObjectiveResource and the NSObject methods use the "get" prefix for their getters. Although this is a common idiom in some languages like Java, the "get" prefix is always omitted in Cocoa except in a very specific case. From Apple's coding guidelines:

Use "get" only for methods that return objects and values indirectly. You should use this form for methods only when multiple items need to be returned.

So methods like "getRemoteId" and "getRemoteSite" would be better as "remoteId" and "remoteSite". Things like Key-Value-Coding also depend on this convention. Setters do use the set prefix, so they can stay as is.

References: * http://developer.apple.com/docum... * http://cocoadevcentral.com/artic... * http://cocoadevcentral.com/artic...

Note: I'm insanely impressed by this project and eager to try it out down the road. So this ticket is filed with the intention of helping make ObjectiveResource more intuitive and natural to use... not to nitpick. :)

Reported by Scott Guelich · February 6th, 2009 @ 11:38 PM

State: new
Assigned to: nobody

Activity

  1. Joshua Vickery
    Joshua Vickery
    • Milestone set to ObjectiveResource 1.01

    Excellent point.

    February 8th, 2009 @ 11:16 AM

  2. jjburka
    jjburka
    • Assigned user set to jjburka

    February 9th, 2009 @ 05:28 PM

  3. Joshua Vickery
    Joshua Vickery

    James -- we need to be careful with this one because it will mean a change to the API. We should either hold off on this (maybe have a 1.01 bugfix build in the meantime) or figure out a way to handle this gracefully.

    February 10th, 2009 @ 04:16 PM

  4. Joshua Vickery
    Joshua Vickery
    • Milestone changed from ObjectiveResource 1.01 to ObjectiveResource 1.1

    February 10th, 2009 @ 04:19 PM

  5. jjburka
    jjburka
    • Assigned user cleared.

    February 16th, 2009 @ 10:03 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.