• 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: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2


  • Subject: Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • From: Eric Ocean <email@hidden>
  • Date: Tue, 26 Oct 2004 20:43:16 -0700

Although it's not at all common, I started using the following method format a while back and it's worked well for me:

- (void)
reloadDataRepresentation:(NSData *)data
ofType:(NSString *)type
withFileName:(NSString *)theFileName
folderPath:(NSString *)theFolderPath
folderName:(NSString *)theFolderName;

I find it much easier to scan for method names and identify method parts with this arrangement.

- (void)
reloadDataRepresentation:(NSData *)data
ofType:(NSString *)type
withFileName:(NSString *)theFileName
folderPath:(NSString *)theFolderPath
folderName:(NSString *)theFolderName;
{
// implementation here
}

I do a similar thing when using multi-part methods:

NSData *localVar = [NSData dataWithBytesNoCopy:arg1
length:arg2
freeWhenDone:NO];

I use a tab after the "[NSData" so that the method parts below it line up easily. I find the convention of lining up the colons to be (a) tedious and (b) difficult to read. Right justification for method parts is difficult to read in English, and looks strange on screen.

I've gone back and forth with spacing between method parts and arguments, and use no space currently because the components tend to "float" to much when spaces are used.

I've wanted to right an Objective-C pretty printer for a while. I think that would be a useful community project.

Regards,

Eric Ocean _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
      • From: Scott Stevenson <email@hidden>
References: 
 >[ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Marco Scheurer <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Keith Anderson <email@hidden>)
 >[OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Graham cox <email@hidden>)
 >Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Re: Cocoa Java futures, NDA's etc
  • Next by Date: Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Previous by thread: Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Next by thread: Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Index(es):
    • Date
    • Thread