[SVN] r2610 (Objective-C)

Allan Odgaard throw-away-1 at macromates.com
Fri Jan 27 14:16:12 UTC 2006


On 27/1/2006, at 3:42, Chris Thomas wrote:

> Make the Objective-C snippets consistent. You're welcome to argue  
> with my style choices if you like. My concern is consistency.

Thanks, the inconsistency has long nagged me.

As for style choices, I'd argue that we should mimic that of Apple,  
as that's likely what most would use (or at least “safe ground”).

Since I don't see their style guide anywhere, there are 3 potential  
sources for extraction:

  * /Developer/Documentation
  * /Developer/Examples
  * The WebKit style guide [1]

While these are not in full agreement, and e.g. the NSAnimation class  
documentation (which is recent) uses “NSArray*” instead of “NSArray  
*” I think there are two things they agree on, that currently the Obj- 
C bundle doesn't follow (so which I think should be changed to  
conform to Apple's style):

No space after the * when used to indicate that the variable is a  
pointer, e.g.:
    NSSomeType *someType;

And no space after the return type or argument type in methods, e.g.:
    - (id)method:(id)arg1 withArgument:(id)arg2;


[1] http://webkit.opendarwin.org/blog/?page_id=25




More information about the textmate-dev mailing list