Re: Amount of Arguments per Method
Re: Amount of Arguments per Method
- Subject: Re: Amount of Arguments per Method
- From: WT <email@hidden>
- Date: Mon, 22 Jun 2009 17:03:33 +0200
On Jun 22, 2009, at 4:14 PM, Andy Lee wrote:
On Jun 22, 2009, at 4:03 AM, Roland King wrote:
This still the longest one or has Apple outdone themselves since?
11 args, you really wouldn't want much more than this.
-
(id
)initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel
:
That's still the longest, both by name length (148) and number of
arguments, if you look only at the most commonly used frameworks.
However, as of Leopard, the longest *documented* method name (150,
though with only 9 arguments) is
<snip>
This brings to mind a peeve of mine: Apple's unofficially sanctioned
practice, followed by a lot of people, of NOT throwing in some white
space in between parts of method names. Programmers spend most of
their time *reading* code (their own or other people's), and with
method names as verbose as those found in Cocoa, it seems to me that
adding some white space ought to be a common practice. Alas...
I mean, seriously, how easy is it to read
- (id) outputImageProviderFromBufferWithPixelFormat:(NSString*)format
pixelsWide:(NSUInteger)width pixelsHigh:(NSUInteger)height baseAddress:
(const void*)baseAddress bytesPerRow:(NSUInteger)rowBytes
releaseCallback:(QCPlugInBufferReleaseCallback)callback releaseContext:
(void*)context colorSpace:(CGColorSpaceRef)colorSpace shouldColorMatch:
(BOOL)colorMatch
(copied directly from the documentation link Andy provided)
compared to
- (id) outputImageProviderFromBufferWithPixelFormat: (NSString*) format
pixelsWide: (NSUInteger) width
pixelsHigh: (NSUInteger)
height
baseAddress: (const void*)
baseAddress
bytesPerRow: (NSUInteger)
rowBytes
releaseCallback:
(QCPlugInBufferReleaseCallback) callback
releaseContext: (void*) context
colorSpace:
(CGColorSpaceRef) colorSpace
shouldColorMatch: (BOOL) colorMatch
I know that XCode will automatically pretty-print code for us, but I'm
talking about Apple's documentation (and code-sharing in this list and
elsewhere). It's not like pdfs or html pages kill trees, you know.
Wagner
_______________________________________________
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