On Apr 25, 2012, at 4:08 PM, Conrad Shultz wrote:

> On 4/25/12 3:44 PM, koko wrote:
>> 
>> On Apr 25, 2012, at 2:06 PM, Mikkel Islay wrote:
>> 
>>> the NSConference 
>> 
>> Violation … only Apple can use the NS prefix !
> 
> Do you understand *why* everyone was making a big deal about your choice
> of prefix?  It's not because people here derive satisfaction from
> enforcing Apple's guidelines or documentation notes.
> 
> Apple actually reserves ALL two letter prefixes (don't have the doc link
> handy, but trust me that this is the case).  In addition to NS, some
> others that they use:  UI, CT, SK, MF, CI, CT, CM come to mind.

They also use some three-letter prefixes, like DOM and Web. So there's really 
no safety here.

> 
> The main reason for this reservation is to prevent collision of a class
> that might be furnished in a future SDK with your classes.  By choosing
> to use a two-letter prefix you are creating the possibility that some OS
> update, for example, will suddenly break your application.
> 
> The same logic applies to prefixing method names in categories.  Doubly
> so for root classes.  For example, in a category on NSObject, instead of
> writing
> 
> -performBlock:afterDelay:
> 
> I opted to use:
> 
> -SQS_performBlock:afterDelay:
> 
> (Because of course Apple would *never* add a -performBlock:afterDelay:
> method.)

The real solution to this problem is true namespaces instead of the ad-hoc 
prefixing we currently abuse: 
http://www.optshiftk.com/2012/04/draft-proposal-for-namespaces-in-objective-c/

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to