Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2001 16:26:05 +0200
From:      Brad Knowles <brad.knowles@skynet.be>
To:        j mckitrick <jcm@FreeBSD-uk.eu.org>, freebsd-chat@freebsd.org
Subject:   Re: code density vs readability
Message-ID:  <p05100334b7d8e6544d17@[194.78.144.27]>
In-Reply-To: <20010927141333.A44288@dogma.freebsd-uk.eu.org>
References:  <20010927141333.A44288@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At 2:13 PM +0100 9/27/01, j mckitrick wrote:

>  what guidelines do you personally follow to balance readability vs
>  efficiency of source code?

	Whatever feels right.  ;-)

>  Can lack of blank lines and other whitespace easily become an impediment to
>  readability?  When (IYO) is there TOO much?

	Yup, this can be a problem.

	Myself, I see it like writing prose.  I don't put a blank line 
between every sentence, only between paragraphs.  However, as verbose 
as I am, sometimes even just a single sentence is several lines long, 
and becomes a paragraph in and of itself.  In C, I also like to put 
opening and closing braces on a line by themselves, in a more 
Pascal-like style as opposed to classic K&R style.

>  One of the software engineers I work with (from mainframe/DOS days) has his
>  code spread out so thin, you can page down 3 or 4 pages before you start to
>  see meaningful code, and he seems to skip a line after almost every line of
>  code.  Not to mention spaces before and after every parenthesis, brace, or
>  bracket.  It seems this would make it easy to read the first time, but a
>  nuisance after that.

	If it's so bad, you can always run it through a program to 
reformat it afterwards.  Indeed, I believe that the judicious use of 
formatting programs can help set a common project-wide "style" to 
which all code will comply, because all code gets fed through the 
formatter before being submitted.

-- 
Brad Knowles, <brad.knowles@skynet.be>

H4sICIFgXzsCA2RtYS1zaWcAPVHLbsMwDDvXX0H0kkvbfxiwVw8FCmzAzqqj1F4dy7CdBfn7
Kc6wmyGRFEnvvxiWQoCvqI7RSWTcfGXQNqCUAnfIU+AT8OZ/GCNjRVlH0bKpguJkxiITZqes
MxwpSucyDJzXxQEUe/ihgXqJXUXwD9ajB6NHonLmNrUSK9nacHQnH097szO74xFXqtlbT3il
wMsBz5cnfCR5cEmci0Rj9u/jqBbPeES1I4PeFBXPUIT1XDSOuutFXylzrQvGyboWstCoQZyP
dxX4dLx0eauFe1x9puhoi0Ao1omEJo+BZ6XLVNaVpWiKekxN0VK2VMpmAy+Bk7ZV4SO+p1L/
uErNRS/qH2iFU+iNOtbcmVt9N16lfF7tLv9FXNj8AiyNcOi1AQAA

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05100334b7d8e6544d17>