Article View: comp.lang.c.moderated
Article #2184Re: Bad Style Contest - We Have a Winner!
From: David Thomas Richard Given
Date: Thu, 07 Mar 1996 00:25
Date: Thu, 07 Mar 1996 00:25
44 lines
2299 bytes
2299 bytes
In article <4h779j$5ep@solutions.solon.com>,
Network News <news@dcs.warwick.ac.uk> wrote:
>David Thomas Richard Given <dtrg@st-andrews.ac.uk> wrote:
>>Definately. I use lots of white space:
>
><pet peeve>
>Defin*i*tely.
></pet peeve>
That one always gets me... :)
(snip)
>(Sorry about the excessive quoting. I think it's necessary in this
>case.)
>
>For a contrived example, I find it rather fails to make your point. I
>find the second version of the function far more understandable. The
>code is all visually close together, which helps a lot with larger
>sections of code. Blank lines waste vertical space. Looking at the
>code, it is immediately obvious that it allocates memory, with error
>checking, then does_something_with the memory, and then frees the
>memory. Comments and blank lines do not help, and in your first
>version of the code distract one's attention from what really matters
>-- the code.
Well, YM really does V. I don't like the second one because all you see
is a solid block of code. There aren't any visual cues as to the semantic
grouping.
It's all really a matter of personal preference. I'm more productive
using the code I find most readable. You're more productive with the code
*you* find most readable, even if I don't.
>BTW, there's a bug in the second version.
>
> if (!variable2 = (char *)malloc(size))
Well, I never use that construct, so I have an excuse...
--
-------------------------------------------------------------------------------
Why do people surf the Information Superhighway? Won't they get run over?
http://www-hons-cs.cs.st-andrews.ac.uk/~dg
Sun-Earther David Daton Given of Lochcarron
Technical Details
Message-ID:
<4hlae2$4df@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4fjmdt$og4@solutions.solon.com> <4g27nn$qaj@solutions.solon.com> <4h2thl$1io@solutions.solon.com> <4h779j$5ep@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: dtrg@st-andrews.ac.uk (David Thomas Richard Given) Newsgroups: comp.lang.c.moderated Subject: Re: Bad Style Contest - We Have a Winner! Date: 6 Mar 1996 18:25:38 -0600 Organization: University Of St. Andrews, Fife, UK. Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4hlae2$4df@solutions.solon.com> References: <4fjmdt$og4@solutions.solon.com> <4g27nn$qaj@solutions.solon.com> <4h2thl$1io@solutions.solon.com> <4h779j$5ep@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com