Re: Pouring factoids into the thread bound wound of time....Re: Size of a Method
Brandon Hunt <brandon.hunt <at> gmail.com>
2004-12-02 17:21:23 GMT
There probably is some more updated data in the second version of Code
Complete, but I haven't had a chance to read that one yet. Too many
things on the "to-be-read" list, currently
I had noticed that while a large portion of Code Complete was helpful,
the statistics didn't really seem to be true (that was a couple of
years ago).
Brandon
On Thu, 2 Dec 2004 09:24:56 +0100, Jim Cheesman <mogrim <at> arrakis.es> wrote:
>
> Are there no similar data post 1993? If I'm not mistaken the data are taken
> from Code Complete, an excellent book that does however predate OOP - I'm
> sure many of the points are still relevant, but I do wonder what influence
> modern IDEs and programming practices have on these results.
>
> Regards,
> Jim
>
> > -----Mensaje original-----
> > De: John Carter [mailto:john.carter <at> tait.co.nz]
> > Enviado el: miercoles, 01 de diciembre de 2004 23:45
> > Para: refactoring <at> yahoogroups.com
> > Asunto: Pouring factoids into the thread bound wound of time....Re:
> > [refactoring] Size of a Method
>
>
> >
> >
> >
> > On Mon, 22 Nov 2004, raitulsi wrote:
> >
> > > Is there any limit as far as the number of lines of codes that
> > > would make a method ideal is concerned? thanks.
> >
> > I would have thought this very long thread would have at some
> > stage fallen
> > across this stream of factoids... (Plenty of stuff for discussion on
> > this web page...)
> >
> >
> > Extracted from...
> >
> > http://www.softwarelogics.co.uk/sl_facts.html
> >
> > The optimal length for the name of a routine is 9-15 characters.
> > McConnell (1993), p.81
> >
> > Up to 90% of code can be dedicated to error and exception handling,
> > housekeeping, etc., with as little as 10% for cases for which the system
> > was nominally built. Shaw in Bentley (1982) McConnell (1993), p.40
> >
> > Extremely modularised code (eg, 10 lines per routine) is no
> > easier to read
> > than completely unstructured code. Breaking code into routines of
> > about 25
> > lines increases comprehension by up to two thirds. Conte, Dunsmore &
> > Shen (1986) McConnell (1993), p.93
> >
> > Larger routines (more than 65 lines of code) are cheaper to develop (per
> > line of code). McConnell (1993), p.93
> >
> > A routines size is inversely correlated to the number of errors
> > in it: the
> > bigger the better. Basili & Perricone (1984) McConnell (1993),
> > p.93
> >
> > Small routines (32 lines or less) are neither less expensive nor less
> > faulty. Card, Church & Agresti (186); Card & Glass (1990)
> > McConnell (1993), p.93
> >
> > A study of 450 routines showed that small routines (up to 143 lines of
> > code) had 23% more errors than large ones. Selby and Basili (1991)
> > McConnell (1993), p.93
> >
> > The number of errors in a routine does not correlate with its
> > size, though
> > it does reflect its structural complexity and the amount of data.
> > Shen et al. (1985) McConnell (1993), p.93
> >
> > The code that needs least changes averages 100-150 lines per routine.
> > Lind & Vairavan (1989) McConnell (1993), p.93
> >
> > IBM found that the most buggy routines were over 500 lines in length. The
> > code that needs least changes averages 100-150 lines per routine.
> > Thereafter, the error rate is proportional to routine size. Jones
> > (1986a) McConnell (1993), p.94
> >
> >
> >
> > John Carter Phone : (64)(3) 358 6639
> > Tait Electronics Fax : (64)(3) 359 4632
> > PO Box 1645 Christchurch Email : john.carter <at> tait.co.nz
> > New Zealand
> >
> > The universe is absolutely plastered with the dashed lines exactly one
> > space long.
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
> Yahoo! Groups Links
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/umvwlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/refactoring/
<*> To unsubscribe from this group, send an email to:
refactoring-unsubscribe <at> yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/