Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
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