Search the web
Sign In
New User? Sign Up
parlezuml · Parlez UML Study Groups
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Method Length - How Long Is Too Long?   Message List  
Reply | Forward Message #313 of 346 |
Re: Method Length - How Long Is Too Long?



>
> Maybe lines of code per method is the wrong metric?
>
> What about the rule of thumb of each method does one thing and one
> thing only? I'm finding it hard to think of a rule for to really
> define what "one thing" is, but it's going to make writing unit tests
> more difficult and complex if you have to test each of your methods
> for multiple behaviours and side effects.
>
> Normally I find that if a method is too long, it's doing too much and
> should be split into a number of more simple methods.
>

So if a 5,000 line method only did "one thing", it would be okay?




Sun Feb 22, 2009 5:54 pm

jasongorman_uk
Online Now Online Now
Send Email Send Email

Forward
Message #313 of 346 |
Expand Messages Author Sort by Date

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...
jasongorman_uk
Online Now Send Email
Feb 22, 2009
12:08 am

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,...
David Laing
mr_davidlaing
Offline Send Email
Feb 22, 2009
12:30 pm

I notice you didn't answer the question ;-) ... context of a ... others) ... other - ... different ... start ... on, ... Who ... where ... impression...
jasongorman_uk
Online Now Send Email
Feb 22, 2009
12:31 pm
Daniel C. Kline
danielckline
Offline Send Email
Feb 22, 2009
4:11 pm

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...
Jason Gorman
jasongorman_uk
Online Now Send Email
Feb 22, 2009
4:22 pm

... 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...
ahpeeyem
Offline Send Email
Feb 22, 2009
5:52 pm

... So if a 5,000 line method only did "one thing", it would be okay?...
jasongorman_uk
Online Now Send Email
Feb 22, 2009
5:54 pm

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...
jasongorman_uk
Online Now Send Email
Feb 22, 2009
5:59 pm

... 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...
Bayley, Alistair
abayley2
Offline Send Email
Feb 23, 2009
11:19 am

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...
Pradeep (Gmail)
pradeepkeya
Offline Send Email
Feb 23, 2009
12:18 pm

... 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...
Bayley, Alistair
abayley2
Offline Send Email
Mar 11, 2009
9:47 am

IMHO It is too long when * there are still some lines to read but you have already forgotten what you've read * you need to take down notes to...
Arthur Carpio
acarpio1975
Offline Send Email
Mar 12, 2009
1:07 am

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...
Daniel C. Kline
danielckline
Offline Send Email
Mar 12, 2009
7:20 am

How long is too long?? THIS TOPIC HAS BEEN ON FOR TOO LONG!!! STOP THIS NON SENSE! ... From: Bayley, Alistair <Alistair_Bayley@...> Subject:...
Pippen
s_vinck1
Offline Send Email
Mar 12, 2009
8:43 am

... 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...
Glenn Stanton
gmstanton
Offline Send Email
Feb 23, 2009
5:45 pm

... 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...
ahpeeyem
Offline Send Email
Feb 23, 2009
1:53 pm

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...
Alex Walgreen (WAVE G...
startpixel
Offline Send Email
Feb 23, 2009
12:21 pm

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...
Balakrishnan S
mailbala31
Offline Send Email
Feb 24, 2009
5:09 am

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...
David Laing
mr_davidlaing
Offline Send Email
Feb 24, 2009
9:20 am

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...
Matt Wynne
mattwynneatf...
Offline Send Email
Feb 24, 2009
9:20 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help