Efficiency AND Readability

Barry Margolin barmar at think.COM
Tue Nov 8 04:41:37 AEST 1988


In article <3386 at geaclib.UUCP> daveb at geaclib.UUCP (David Collier-Brown) writes:
>  A good counter-example to the claim that efficient code is
>unreadable (and also the claim that its non-portable) exists in the
>TeX typesetting implementation.

First, a disclaimer: I've never found WEB programs very
understandable, and the coding style it appears to promote is not very
good (there's LOTS of global variables).

More to the point, though, is that I think you are talking about a
different kind of readability than what WEB addresses.  WEB attempts
to make the program layout more readable, by using fonts to highlight
things like comments, and by loosening the restrictions on the order
in which program elements must appear, so that the text can follow the
design better.

However, the kind of readability being pitted against efficiency is at
a lower level.  For example, if 'a>>b' is used in C as an efficient
way to divide a positive number by 2**b, it will be just as confusing
in WEB.  WEB doesn't have any magic way to make confusing statements
or algorithms less confusing.  It does promote more thorough
commenting, but that doesn't guarantee anything; we've been asking
people to comment vigorously for years (and I admit that I'm guilty of
commenting less than I should).

Barry Margolin
Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.lang.c mailing list