• 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: Wrapping C functions in Objective C proxy objects: naming convention?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Wrapping C functions in Objective C proxy objects: naming convention? (From: "Austin Ziegler" <email@hidden>)
 >Re: Wrapping C functions in Objective C proxy objects: naming convention? (From: Alexander Spohr <email@hidden>)
 >Re: Wrapping C functions in Objective C proxy objects: naming convention? (From: "Austin Ziegler" <email@hidden>)

  • Prev by Date: Re: [MyClass class] returning superclass's class
  • Next by Date: Re: InputManagers in Leopard
  • Previous by thread: Re: Wrapping C functions in Objective C proxy objects: naming convention?
  • Next by thread: Re: Wrapping C functions in Objective C proxy objects: naming convention?
  • Index(es):
    • Date
    • Thread