• 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: Amount of Arguments per Method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Amount of Arguments per Method


  • Subject: Re: Amount of Arguments per Method
  • From: WT <email@hidden>
  • Date: Tue, 23 Jun 2009 06:36:24 +0200

On Jun 23, 2009, at 6:03 AM, Michael Ash wrote:

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

Exactly! Moreover, often times (especially if you're part of a team) one doesn't write code that's read just by oneself.


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


  • Follow-Ups:
    • Re: Amount of Arguments per Method
      • From: Bill Bumgarner <email@hidden>
References: 
 >Amount of Arguments per Method (From: Chunk 1978 <email@hidden>)
 >Re: Amount of Arguments per Method (From: WT <email@hidden>)
 >Re: Amount of Arguments per Method (From: Roland King <email@hidden>)
 >Re: Amount of Arguments per Method (From: Andy Lee <email@hidden>)
 >Re: Amount of Arguments per Method (From: WT <email@hidden>)
 >Re: Amount of Arguments per Method (From: Paul M <email@hidden>)
 >Re: Amount of Arguments per Method (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: Beginner Question Re: Memory Management
  • Next by Date: Re: Warnings suggest compiler confusion between 32 and 64 bit code.
  • Previous by thread: Re: Amount of Arguments per Method
  • Next by thread: Re: Amount of Arguments per Method
  • Index(es):
    • Date
    • Thread