• 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: Objective C language [NEWBEE QUESTIONS]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C language [NEWBEE QUESTIONS]


  • Subject: Re: Objective C language [NEWBEE QUESTIONS]
  • From: lbland <email@hidden>
  • Date: Fri, 30 Jan 2004 14:11:45 -0500

On Jan 30, 2004, at 1:44 PM, John Randolph wrote:

warning: hidden name clashing ahead, many mysterious headaches in gdb ...

Some people add a underscore prefix for private methods:

_setVariable:

Let me give an official "don't do that!" from Apple DTS here. Preceding your method names with a single underscore gives you a very high risk of a conflict with a private AppKit API.

Yup, my point exactly! those "some people" took their lead from NeXT engineers. That is why I suggested a real long prefix like THIS_IS_MY_PRIVATE_METHOD_DO_NOT_USE_IT_. Choose your own prefix that won't conflict with something else. The fact that Apple (and others) don't publish their private API means you have to be careful not to conflict with it. In the "old days" there were plenty of private method names in the AppKit that didn't have an underscore prefix and debugging took days before a "... I didn't know that method name was in the run time ..." followed by a "&(*%##@" suffix.

:-)

Lance Bland
mailto:email@hidden
VVI
888-VVI-PLOT
http://www.vvi.com
_______________________________________________
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.

References: 
 >Objective C language [NEWBEE QUESTIONS] (From: "Alexander F. Hartner" <email@hidden>)
 >Re: Objective C language [NEWBEE QUESTIONS] (From: Philip Mötteli <email@hidden>)
 >Re: Objective C language [NEWBEE QUESTIONS] (From: lbland <email@hidden>)
 >Re: Objective C language [NEWBEE QUESTIONS] (From: John Randolph <email@hidden>)

  • Prev by Date: Re: NSTypesetter and smart quotes
  • Next by Date: Re: How to use a class, which may not be available
  • Previous by thread: Re: Objective C language [NEWBEE QUESTIONS]
  • Next by thread: Re: Objective C language [NEWBEE QUESTIONS]
  • Index(es):
    • Date
    • Thread