• 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: enough of accessors - how about private method naming conventions in the real world?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enough of accessors - how about private method naming conventions in the real world?


  • Subject: Re: enough of accessors - how about private method naming conventions in the real world?
  • From: Nicholas Riley <email@hidden>
  • Date: Wed, 7 Aug 2002 01:28:22 -0500
  • Mail-followup-to: "Michael B. Johnson" <email@hidden>, email@hidden

On Tue, Aug 06, 2002 at 10:48:45PM -0700, Michael B. Johnson wrote:
> So we all know that Apple has coopted the "prefix your private methods
> with an underscore" idiom, and told us not to use it. Annoyingly
> enough, this is fair, since we don't have source to the Apple
> frameworks, and since any private methods one might implement using the
> same naming convention would silently override their particular
> implementation, leading to all sorts of nasty, hard to find bugs.

Actually, I didn't know this, where is it documented?

> I do *not* want to do some sort of prefix akin to the class names (i.e.
> renaming _foo in BARBigCoolClass as _BAR_foo), but I realize that I
> need to publish whatever idiom I choose so that users of my classes now
> have two naming schemes they must avoid - Apple's and mine.

That's what I've done in certain cases (when I'm adding categories to
arbitrary applications, say :-) Most of the time I'm not subclassing
any humongous Apple classes, anyway, so I wouldn't regard this as a
hardship. Although I tend to use BAR_foo instead of _BAR_foo.

--
=Nicholas Riley <email@hidden> | <http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: enough of accessors - how about private method naming conventions in the real world?
      • From: Bill Cheeseman <email@hidden>
References: 
 >enough of accessors - how about private method naming conventions in the real world? (From: "Michael B. Johnson" <email@hidden>)

  • Prev by Date: NSAutoreleasePool with java questions
  • Next by Date: Re: Print Dialog in Mac OS X
  • Previous by thread: enough of accessors - how about private method naming conventions in the real world?
  • Next by thread: Re: enough of accessors - how about private method naming conventions in the real world?
  • Index(es):
    • Date
    • Thread