From owner-freebsd-chat Thu Sep 27 8: 3: 6 2001 Delivered-To: freebsd-chat@freebsd.org Received: from riker.skynet.be (riker.skynet.be [195.238.3.132]) by hub.freebsd.org (Postfix) with ESMTP id 3CF4337B448 for ; Thu, 27 Sep 2001 08:03:03 -0700 (PDT) Received: from [194.78.144.27] ([194.78.144.27]) by riker.skynet.be (8.11.6/8.11.6/Skynet-OUT-2.15) with ESMTP id f8RF0Oq29767; Thu, 27 Sep 2001 17:00:26 +0200 (MET DST) (envelope-from ) Mime-Version: 1.0 X-Sender: brad.knowles@pop.skynet.be Message-Id: In-Reply-To: <20010927141333.A44288@dogma.freebsd-uk.eu.org> References: <20010927141333.A44288@dogma.freebsd-uk.eu.org> Date: Thu, 27 Sep 2001 16:26:05 +0200 To: j mckitrick , freebsd-chat@freebsd.org From: Brad Knowles Subject: Re: code density vs readability Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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, 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