Re: Amount of Arguments per Method
Re: Amount of Arguments per Method
- Subject: Re: Amount of Arguments per Method
- From: Paul M <email@hidden>
- Date: Tue, 23 Jun 2009 11:46:24 +1200
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.
That's just my view. The point is - do what works best for you, and
leave others do what's best for them.
Trying to force others to your preference is a great way to stifle
creativity, enjoyment and quality. Everybody is different and works
differently, and the very best they can do is to do what works best for
them.
paulm
On 23/06/2009, at 3: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 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