Date: Tue, 22 Apr 2003 17:22:18 +0100 From: Colin Percival <colin.percival@wadham.ox.ac.uk> To: Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>, freebsd-chat@freebsd.org Subject: Re: Code layout and debugging time Message-ID: <5.0.2.1.1.20030422171035.01c5e258@popserver.sfu.ca> In-Reply-To: <20030422132906.GB64101@dogma.freebsd-uk.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
At 14:29 22/04/2003 +0100, Jonathon McKitrick wrote: >I was just reading an interesting statement in Code Complete: > >"Although this particular statistic may be hard to put to work, a study by >Gorla, Benander, and Benander found that the optimal number of blank lines >in a program is about 8 to 16 percent. Above 16 percent, debug time >increases dramatically (1990)." > >Doesn't this seem to contradict the idea that clear, well-formatted code >with lots of blank lines is easier to read and understand? How could >debugging be any different? On older systems, the time necessary for scrolling around could make a significant contribution (remember, that study was in 1990 -- things may have changed since then). Another possibility, however, is that introducing too many blank lines breaks up the code in a manner which impairs readability, causing people to lose time re-reading a block of code several times. It would be interesting to see if a similar effect can be observed in heavily commented code; I have a feeling that one might find that writing comments into a distinct "documentation" file would have an advantage over the usual practice of writing comments in the middle of code. Colin Percival
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.0.2.1.1.20030422171035.01c5e258>