TeX and friends and literate programming (was Re: [pdftex] pdftex compression -- proposed addition to manual)

Ed L Cashin ecashin at terry.uga.edu
Sun Jun 1 17:13:37 CEST 2003

"M. Wroth" <mark at astrid.upland.ca.us> writes:

> One of the *reasons* I'm a believer in literate programming is that
> it both gives good facilities for and strongly encourages good
> commenting.  Very few literate programs live up to Knuth's standard
> of being enjoyable essays in their own right.  But they seem to get
> better comments than illiterate* programs.

I was very excited about literate programming when I first heard about
it, because I respect Don Knuth so much and because TeX is great

However, when I learned specifics on how it works, I noticed that the
things that it does can be done more succinctly in the code itself.

In literate programming, if you have a piece of code that does
something you can describe, you label that piece of code and write
about what it does.  An alternative is to use the programming language
itself to do that: you make the code a function and you give the
function a descriptive name.

I spoke to several programmers including Thanh at TUG 2000 who had
worked with the TeX sources.  I came away with the impression that
although Knuth created a great work in TeX, the code itself is pretty
hard to work with.

Programming languages are *for* describing what computers do.  In my
experience they are more concise and readable than English when they
are used in this way (the way where you break the problem down into
objects or into functions and structured data types).

While Knuth's code can create a nice book to read all the way through,
it isn't the kind of code you can understand at a glance.  And from
what I hear it's not too easy to modify or extend.  The reason it's
successful is that it's so wonderfully efficient, effective, and
bugfree.  But I'd rather see a future with readable code than literate

--Ed Cashin                   PGP public key:
  ecashin at terry.uga.edu       http://www.terry.uga.edu/~ecashin/pgp/

More information about the pdftex mailing list