RE: [parlezuml] Method Length - How Long Is Too Long?
How long is too long??
THIS TOPIC HAS BEEN ON FOR TOO LONG!!! STOP THIS NON SENSE!
--- On Wed, 3/11/09, Bayley, Alistair <Alistair_Bayley@...> wrote:
From: Bayley, Alistair <Alistair_Bayley@...> Subject: RE: [parlezuml] Method Length - How Long Is Too Long? To: parlezuml@yahoogroups.com Date: Wednesday, March 11, 2009, 10:47 AM
> From: parlezuml@yahoogrou ps.com
> [mailto:parlezuml@yahoogrou ps.com] On Behalf Of Bayley, Alistair
>
> > From: parlezuml@yahoogrou ps.com
> > [mailto:parlezuml@yahoogrou ps.com] On Behalf Of jasongorman_ uk
> > Sent: 22 February 2009 18:00
> >
> > Sorry to labour the point, but if I made the following statement:
> >
> > "Any method containing more than 5,000 lines of executable code and
> > that will potentially need to be maintained by a human being is too
> > long and needs to be broken down into smaller methods."
> >
> > During a court case for professional software development
> > malpractice, who here would argue against that?
> >
> > Jason Gorman
>
>
> What's your evidence? Earlier I think you suggested 5-10 lines as your
> preferred upper limit.
>
> See the 2nd-last paragraph on this page (a summary of Code Complete,
> which I do not have):
> http://c2.com/ cgi/wiki? LongFunctions
> Looks like 50-200 lines per method is optimal.
I found some evidence (OK, someone else did). From this blog entry:
(which I've only skimmed over, so cannot properly summarise.)
Alistair
************ ********* ********* ********* ********* ********* ********
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
************ ********* ********* ********* ********* ********* ********
One of the barriers to building a proper profession of software development is arguably that there's a lack of majority consensus on, well, pretty much...
I think the key is that a particular practise works well in the context of a specific collection of other practises. For example, Iterative Development, TDD,...
I notice you didn't answer the question ;-) ... context of a ... others) ... other - ... different ... start ... on, ... Who ... where ... impression...
The question is: Method Length - How Long Is Too Long? Â The problem with total contextualism is the problem with total relativism, surely. Can anyone suggest...
... relativism, surely. Can anyone suggest a context where a method containing, say, 5,000 LOC is fine? ... the majority will reach consensus on? Maybe lines...
Sorry to labour the point, but if I made the following statement: "Any method containing more than 5,000 lines of executable code and that will potentially...
... What's your evidence? Earlier I think you suggested 5-10 lines as your preferred upper limit. See the 2nd-last paragraph on this page (a summary of Code...
Oppsss.... Good debate! Seems, the bench mark depends of the organization policies or the coding practice it follows. What I have benched mark is a mix of many...
... I found some evidence (OK, someone else did). From this blog entry: http://dubroy.com/blog/2009/03/09/method-length-are-short-methods-actual ly-worse/ we...
I love this ... I would add: You can't describe it without referring to the code. From: parlezuml@yahoogroups.com [mailto:parlezuml@yahoogroups.com] On Behalf...
... what if I delegate? does that count? my Java method was only 3 lines long but delegated to something that was 5,020 lines of Forth code. (which I didn't...
... Nope it would be pretty horrible wouldn't it, and in anything I've ever written there would have been plenty of places in that 5000 lines for logical...
Hi all, I always tend to make a method not more than 30 to 40 lines of code, so a human can see the whole method on screen without scrolling. This makes it...
Hi, I suppose rather than continuing this discussion on the no of lines a method could/should have. We could list the pros & cons of having a method with too...
Alternatively, we could stop focusing on the exceptions, and rather look at the 95% confidence interval. I would be happy to say that 95% of the time, a method...
One line. No more, no less. ;) That's what someone I was pairing with teased me about the other week - lately I seem to try to keep most of my methods down to...