Shorter is always better how?
Less error prone? Five studies cited by McConnel found that routine size
was either inversely correlated with error frequency, or not correlated at
all [1,2,3,4,5]
Easier to understood? A study of upper level comp. sci. students found
that comprehension of a super-modularized program into routines about
10 lines long was no better than their comprehension of a program with
no routines (but when moderate length routines were used, comprehension
scores rose 65%). [6]
Less changes required? Another study finds that code needs to be changed
least when routines average 100 - 150 lines. [7]
So, on the one hand we have several empirical studies which find that
shorter routines do not require less changes, are not easier to understand,
and are not less error prone. All of that relates to software cost in the
real world. On the other hand, we have your unsupported opinion.
[1] Basili & Perricone (1984) "Software Errors and Complexity: An Empi
+rical
Investigation." Communications of the ACM 27, no. 1 (Jan) 42-52.
[2] Shen et al (1985) "Identifying Error-Prone Software --- An Emprici
+al
Study" IEEE Transactions on Software Engineering SE-11 (Apr) 317-
+324
[3] Card, Church, & Agresti (1986) "An Empirical Study of Software Des
+ign
Practices" IEEE Transactions on Software Engineering SE-12 no 2 (
+Feb)
264-271
[4] Card & Glass (1990) "Measuring Software Design Quality". Englewood
CLiffs, N.J.: Prentice Hall
[5] Shelby & Basili (1991) "Analyzing Error-Prone System STructure" I
+EE
Transactions on Software Engineering SE-17 no 2 (Feb) 141-152
[6] Conte, Dunsmore, Shen (1986) "Software Engineering Metrics and Mod
+els"
Menlo Park, Calif: Benjamin/Cummings
[7] Lind & Vairavan (1989) "An Experimental Investigation of Software
Metrics and Their Relationship to Software Development Effort" IEE
+E
Transactions on Software Engineering SE-15 no 5 (May) 649-653
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.