Re: Amount of Arguments per Method

2009-06-25 Thread Ken Ferry
Not a method, but NSCell.h has a function with 13 arguments. APPKIT_EXTERN void NSDrawNinePartImage(NSRect frame, NSImage *topLeftCorner, NSImage *topEdgeFill, NSImage *topRightCorner, NSImage *leftEdgeFill, NSImage *centerFill, NSImage *rightEdgeFill, NSImage *bottomLeftCorner, NSImage *bottomEdg

[Moderator] Re: Amount of Arguments per Method

2009-06-25 Thread Scott Anguish
This thread is closed. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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

Re: Amount of Arguments per Method

2009-06-25 Thread mmalc Crawford
On Jun 23, 2009, at 9:14 AM, WT wrote: On Jun 23, 2009, at 4:57 PM, mmalc Crawford wrote: On Jun 23, 2009, at 4:05 AM, WT wrote: Let's start with bug reporting, which is of general relevance to developers here: Whether or not it's an actual *error* is immaterial -- it's a usability iss

Re: Amount of Arguments per Method

2009-06-23 Thread WT
On Jun 23, 2009, at 4:57 PM, mmalc Crawford wrote: On Jun 23, 2009, at 4:05 AM, WT wrote: Why is it so baffling? The question is not wanting something to be changed, but wanting *bad enough* to have something changed. Because, as has been stated so often, posting messages to a list will n

Re: Amount of Arguments per Method

2009-06-23 Thread mmalc Crawford
On Jun 23, 2009, at 4:05 AM, WT wrote: Why is it so baffling? The question is not wanting something to be changed, but wanting *bad enough* to have something changed. Because, as has been stated so often, posting messages to a list will not cause any change. If you complain about something

Re: Amount of Arguments per Method

2009-06-23 Thread Sean McBride
That can be better, but then you end up with 2x as many arguments, in a way: [NSDictionary dictionaryWithObjectsAndKeys: ob1, key1, ob2, key2, ... etc. On 6/22/09 7:10 AM, Jack Carbaugh said: >With that many arguments, i'd make a dictionary and pass only that >dictionary. I understand y

Re: Amount of Arguments per Method

2009-06-23 Thread WT
On Jun 23, 2009, at 9:33 AM, mmalc Crawford wrote: On Jun 22, 2009, at 10:59 PM, WT wrote: Devpubs listens, and our delivery team (the folks that take the XML and output it to the various formats) ROCK. I am now leaning more and more towards filing a documentation enhancement request. T

Re: Amount of Arguments per Method

2009-06-23 Thread mmalc Crawford
On Jun 22, 2009, at 10:59 PM, WT wrote: Devpubs listens, and our delivery team (the folks that take the XML and output it to the various formats) ROCK. I am now leaning more and more towards filing a documentation enhancement request. This is simply baffling. If you want something to be

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 23, 2009, at 7:45 AM, Scott Anguish wrote: There should be whitespace automatically generated between the necessary bits. There is "necessary" as far as the compiler is concerned and there is "necessary" as far as humans are concerned. The second isn't technically a necessity, and

Re: Amount of Arguments per Method

2009-06-22 Thread Scott Anguish
There should be whitespace automatically generated between the necessary bits. If you'd rather see it the other way (and I can see an argument for that), hit up bugreporter or feedback. Devpubs listens, and our delivery team (the folks that take the XML and output it to the various format

Re: Amount of Arguments per Method

2009-06-22 Thread Rob Ross
I actually had to use that method once in one of my very first Cocoa apps. My personal rule of thumb for my own code is, when a method I write has more than 3 parameters I start to suspect there's a more OO way of breaking up the problem. Huge argument lists indicate a procedural design,

Re: Amount of Arguments per Method

2009-06-22 Thread Bill Bumgarner
Meh. I'd much rather see calls to methods that take many arguments broken up across a number of lines for three reasons (drawing the line at methods that take 4 or more arguments, for me): (0) I can scan any given line of the method invocation sub-expression and know that the aligned colon

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 23, 2009, at 6:03 AM, Michael Ash wrote: On Mon, Jun 22, 2009 at 7:46 PM, Paul M wrote: In documentation, stacking the arguments verticaly is of value. In actual code, I _always_ concatenate on to as few lines as necesary (tho' using double indentation for subsequent lines) as I fin

Re: Amount of Arguments per Method

2009-06-22 Thread Michael Ash
On Mon, Jun 22, 2009 at 7:46 PM, Paul M wrote: > In documentation, stacking the arguments verticaly is of value. In actual > code, I _always_ concatenate > on to as few lines as necesary (tho' using double indentation for subsequent > lines) as I find it makes for much _more_ readable code. > Reaso

Re: Amount of Arguments per Method

2009-06-22 Thread Paul M
In documentation, stacking the arguments verticaly is of value. In actual code, I _always_ concatenate on to as few lines as necesary (tho' using double indentation for subsequent lines) as I find it makes for much _more_ readable code. Reasoning? - I wrote that code, or I've already read it care

Re: Amount of Arguments per Method

2009-06-22 Thread Greg Parker
On Jun 22, 2009, at 1: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:bitmapFo

Re: Amount of Arguments per Method

2009-06-22 Thread Graham Cox
On 23/06/2009, at 1:03 AM, WT wrote: 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 peo

Re: Amount of Arguments per Method

2009-06-22 Thread WT
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:samplesP

Re: Amount of Arguments per Method

2009-06-22 Thread Andy Lee
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:bitmap

Re: Amount of Arguments per Method

2009-06-22 Thread Bill Bumgarner
On Jun 22, 2009, at 6:10 AM, Jack Carbaugh wrote: With that many arguments, i'd make a dictionary and pass only that dictionary. I understand your choice for not doing so however. Why? If you break up the call by hitting return after each argument and line up the colons (which Xcode will d

Re: Amount of Arguments per Method

2009-06-22 Thread Roland King
That one's not mine, that's Apple's. The original poster asked what the longest one was, that's the longest Cocoa one I've come across. I didn't use it! On Jun 22, 2009, at 7:10 PM, Jack Carbaugh wrote: With that many arguments, i'd make a dictionary and pass only that dictionary. I unders

Re: Amount of Arguments per Method

2009-06-22 Thread Jack Carbaugh
With that many arguments, i'd make a dictionary and pass only that dictionary. I understand your choice for not doing so however. jack 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 mor

Re: Amount of Arguments per Method

2009-06-22 Thread Roland King
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: WT wrote: On Jun

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 22, 2009, at 8:05 AM, Chunk 1978 wrote: clearly simplicity is important, but i'd like to know if there is a limit for the amount of arguments which a method can handle? I don't know if there's an upper limit, but I don't recall ever writing a method with more than 5 or 6 arguments. Wh

Re: Amount of Arguments per Method

2009-06-22 Thread Dave Keck
> clearly simplicity is important, but i'd like to know if there is a > limit for the amount of arguments which a method can handle? The C99 standard states that conforming compilers must support at least 127 function arguments. I don't know if GCC enforces a limit above this, but if it doesn't, t

Amount of Arguments per Method

2009-06-21 Thread Chunk 1978
clearly simplicity is important, but i'd like to know if there is a limit for the amount of arguments which a method can handle? also, just for fun, what's the longest method name you've seen? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea