Coding Guidelines are unclear on underscore prefix for ivars

Originator:boredzo
Number:rdar://7004101 Date Originated:2009-06-24T14:40-0700
Status:Open Resolved:
Product:Documentation Product Version:2006-04-04
Classification:Enhancement Reproducible:Not Applicable
 
Summary:
The Coding Guidelines for Cocoa document is unclear on whether the underscore prefix is reserved by Apple on both instance-variable names and method selectors, or only on selectors.

Steps to Reproduce:
1. Read “Typographic Conventions” under “Code Naming Basics” in the Coding Guidelines (http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html#//apple_ref/doc/uid/20001281-1002931-BBCFHEAB).

Expected Results:
The documentation clearly states all the places where the underscore prefix is reserved, and at least the most significant places where it is not.

Actual Results:
The documentation implies that it is reserved on everything, and only explicit calls out method selectors.

Regression:
I don't think it's ever been clear about this, so no.

Notes:
There is some debate among Cocoa programmers about whether one should use the underscore prefix for instance variable names. Mike Lee (who is an Apple engineer) says they are reserved (https://twitter.com/bmf/status/2316498904); Kevin Ballard says that another Apple engineer told him that they are not (https://twitter.com/eridius/status/2316519684). I, for one, would welcome a final, definitive answer in the documentation.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!