Re: Wrapping C functions in Objective C proxy objects: naming convention?
Re: Wrapping C functions in Objective C proxy objects: naming convention?
- Subject: Re: Wrapping C functions in Objective C proxy objects: naming convention?
- From: Ken Thomases <email@hidden>
- Date: Thu, 20 Nov 2008 07:52:56 -0600
On Nov 20, 2008, at 6:58 AM, Austin Ziegler wrote:
result = [calc addDoubleA:a withDoubleB:b]; // #1
Why not -addDouble:withDouble: ?
That is, why are you promoting the argument names into the method
signature? Especially since you're aware that the names are (most
often) useless.
result = [calc addDoubleA:a withDoubleB:b status:&status]; // #2
status = [calc addDoubleA:a withDoubleB:b returning:&result]; // #3
These forms might also make sense, but I'd still leave out the 'A' and
'B'. I believe that Apple's naming conventions suggest that, when a
method outputs multiple values, they should all be output parameters
and none should be via return value. Also, Apple has been migrating
towards using NSError objects output via parameter to handle status.
So, you might want to do the same.
http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden