Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: newbie: a little interpretation help please
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie: a little interpretation help please



El 19/08/2006, a las 1:57, j o a r escribió:

On 19 aug 2006, at 00.35, Ofri Wolfus wrote:

Although it's bad naming, you can also have
- (void)print {
	// do whatever
}

and

- (void)print:(BOOL)reduceFraction {
	// same as -printReducingForDisplay:
}

No, _that_ is bad naming!

Agreed. Remember that selectors are written in a bare format, without the parameter variables named; for example:


@selector(print:)

A programmer looking at that selector, "print:", would at first glance assume that it takes a parameter "the object to be printed", so it's potentially misleading. You should always strive for clarity and if you look at Apple's method names in Cocoa you'll see that they often use longer selector names for the sake of clarity.

G

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >newbie: a little interpretation help please (From: g <email@hidden>)
 >Re: newbie: a little interpretation help please (From: Greg Hurrell <email@hidden>)
 >Re: newbie: a little interpretation help please (From: Ofri Wolfus <email@hidden>)
 >Re: newbie: a little interpretation help please (From: j o a r <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.