Re: Amount of Arguments per Method
Re: Amount of Arguments per Method
- Subject: Re: Amount of Arguments per Method
- From: Michael Ash <email@hidden>
- Date: Tue, 23 Jun 2009 00:03:19 -0400
On Mon, Jun 22, 2009 at 7:46 PM, Paul M<email@hidden> 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.
> Reasoning? - I wrote that code, or I've already read it carefully, so I know
> - as well as I need to - what kinds of arguments it takes. What I'm much
> more interested in is the 'shape' of the code, or it's structure. So fitting
> more on a page is much of more value (but not over-compressing the code as
> this has exactly the oposite effect).
> A problem with an individual function call means I concentrate on the line
> or lines that it occupies, stacking verticaly doesnt help much. If the
> structure of the code is obfusicated, that will always be a problem and an
> ongoing one.
The trouble with this sort of thing is that when you come back to the
code in six months' time you will no longer know what kinds of
arguments it takes and other such important details. Whether it's
better to optimize for the short term or for the long term is of
course a difficult decision that you need to make for yourself. I
personally like to split long methods onto multiple lines or, better
yet, take long methods as a sign of a design flaw and eliminate them
altogether.
Mike
_______________________________________________
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