From owner-freebsd-chat@FreeBSD.ORG Tue Apr 22 09:22:24 2003 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A00CD37B401 for ; Tue, 22 Apr 2003 09:22:24 -0700 (PDT) Received: from mta03-svc.ntlworld.com (mta03-svc.ntlworld.com [62.253.162.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5841743FDD for ; Tue, 22 Apr 2003 09:22:23 -0700 (PDT) (envelope-from colin.percival@wadham.ox.ac.uk) Received: from piii600.wadham.ox.ac.uk ([81.103.196.4]) by mta03-svc.ntlworld.comESMTP <20030422162221.DHHP11246.mta03-svc.ntlworld.com@piii600.wadham.ox.ac.uk>; Tue, 22 Apr 2003 17:22:21 +0100 Message-Id: <5.0.2.1.1.20030422171035.01c5e258@popserver.sfu.ca> X-Sender: cperciva@popserver.sfu.ca X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Tue, 22 Apr 2003 17:22:18 +0100 To: Jonathon McKitrick , freebsd-chat@freebsd.org From: Colin Percival In-Reply-To: <20030422132906.GB64101@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Code layout and debugging time X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 16:22:24 -0000 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