Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > integers to binary

Thread Tools

integers to binary

Michael Wojcik
Posts: n/a

In article <(E-Mail Removed)>, Tim Rentsch <(E-Mail Removed)> writes:
> Al Balmer <(E-Mail Removed)> writes:
> > >On 29 Dec 2005 20:02:04 -0800, in comp.lang.c , Tim Rentsch
> > ><(E-Mail Removed)> wrote:
> > >
> > >(of other different bracing examples)
> > >
> > >>Studies have been done that show the second form results in
> > >>fewer errors.

> >
> > I would be interested if you provided some references to these
> > studies.

> I'm sorry to report that I don't have a reference. It's something I
> remember reading at some point, but that was before I started keeping
> track of references to such things. It's unfortunate, because I think
> the programming community would benefit from doing more studies on
> these kinds of issues and accumulating references to them.

Derek M Jones' _The New C Standard_[1] has an extended discussion on
source code readability with considerable reference to studies of
human vision, reading, and so forth. See the commentary on sentence
766 (the beginning of 6.4 in the Standard), which is PDF page 682 in
the version I have (1.0b). He notes:

Unfortunately there are no studies, using experienced developers,
that compare the effects of different source code layout on reading
performance. Becoming an experienced developer can be said to involve
learning to read source that has been laid out in a number of
different ways. The visually based guidelines in this book do not
attempt to achieve an optimum layout, rather they attempt to steer
developers away from layouts that are likely to be have high error
rates. (68

He later discusses opening brace position and claims that "[t]here
are several reasons for believing that [placing the opening brace on
the same line as other non-white-space characters] results in a
larger number of mistakes being made than [placing it on a line by
itself]", but goes on to note that "[g]iven the lack of experimental
measurements of reading performance for different layout schemes,
there is no empirical evidence to support any guideline
recommendation relating to the visual layout of blocks" (1387).

I have to say that I find Jones' argument rather more persuasive than
a casual description of something someone remembers reading once some
time ago. It may be a fact that some study at some time concluded
that closing brace position X produced a lower error rate among
readers than did closing brace position Y; but at this point it's no
more than an assertion, and even if it is a fact, we lack any basis
on which to judge the study's usefulness. (For example, Jones
provides significant evidence to support the theory that practice
in reading a particular style considerably dominates any effect
inherent in that style. A study that failed to account for that in
some fashion would be useless.)

All that said, even if Tim's example was perhaps infelicitous, I take
his overall point: there are matters of fact relevant to questions of


Michael Wojcik Removed)

Bohemia is only a stage in a man's life, except in the case of fools and
a very few others. It is not a profession. -- Arthur Ransome
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
(8-bit binary to two digit bcd) or (8-bit binary to two digit seven segment) Fangs VHDL 3 10-26-2008 06:41 AM
writing binary file (ios::binary) Ron Eggler C++ 9 04-28-2008 08:20 AM
A 64-bit binary returning a value to a 32-bit binary? C Programming 12 04-08-2007 07:02 AM
Picking out integers from a binary character string C++ 1 06-12-2005 03:19 AM
Re: ostreams, ios::binary, endian, mixed binary-ascii Marc Schellens C++ 8 07-15-2003 12:27 PM