March 1, 2019


Donald Knuth. “Literate Programming ()” in Literate Programming. CSLI, , pg. I believe that the time is ripe for significantly better documentation of . Literate programming: Knuth is doing it wrong. Literate programming advocates this: Order your code for others to read, not for the compiler. Literate. What is Literate programming? Literate programming is a style of programming invented by Donald Knuth, where the main idea is that a program’s .

Author: Groll Meshicage
Country: Jordan
Language: English (Spanish)
Genre: Video
Published (Last): 8 November 2010
Pages: 249
PDF File Size: 1.44 Mb
ePub File Size: 18.30 Mb
ISBN: 223-5-34824-646-5
Downloads: 70260
Price: Free* [*Free Regsitration Required]
Uploader: Zolojinn

The typographic processing of literate programs produces code listings with elegantly formatted documentation and source code.

Literate programming: Knuth is doing it wrong

The Art of Donald E. But as time went on, I’ve become extremely pleased with the name, because I think that a complex piece of software is, indeed, best regarded as a web that has been delicately pieced together from simple materials.

Then when I started writing TeX in this period I began the implementation of TeX in October ofand I finished it in May 78it was consciously done with structured programming ideas.

The following snippet of the wc literate program [11] shows how arbitrary descriptive phrases in a natural language are used in a programning program to create macros, which act as new “operators” in the literate programming language, and hide chunks of code or other macros.

Thus the program can be described in a logical manner.

However, I promise to reply in due time. Literate programming is useful for programs of all sizes. And if you do report an error via email, please do not include attachments of any kind; your message should be readable on brand-X operating systems for all values of X.


But if you looked at the details WEB utilizes the TeX document compiler, which programing a typesetting command language capable of tremendous control over document appearance. There are many factors involved in developing excellent software. The present chunkwhich does the countingwas actually one of the simplest to write. A “closed” subroutine is one which is called into prograjming by a special group of orders incorporated in the master routine or main program.

Keep it simple and straight forward as much as possible. This of course helps readers. The literate programming metalanguage provides two important features. If programs are written in a way that concentrates on explaining their design to human readers, then they can be considered as works of technical literature; it is for this reason that Knuth has named this style of software construction and description “literate programming”.

Writing a literate program is a lot more work than writing a normal program. The unraveling of the chunks can be done in any place in the literate program text file, not programmkng in the order they are sequenced in the enclosing chunk, but as is demanded by the logic reflected in the explanatory text that envelops the whole program.

Knuth: Literate Programming

It is used for instance to analyze complex living organisms or complex social systems. At that time, we had about 25 people litsrate our group that would meet every Friday. Literate Programming in WEB”. This misconception has led to claims that comment-extraction tools, such as the Perl Plain Old Documentation or Java Javadoc systems, are “literate programming tools”.


Literate programming

Hoare had heard rumors about my work and he wrote to Stanford suggesting that I keep publication in mind. Cross references, indices, and different fonts for text, high-level language keywords, variable names, and literals should be proggramming automatic and obvious in the source and the documentation.

Knuth’s broader ideas about documentation and structured programming are laid out in his book, “Literate Programming. Such an author, with thesaurus in hand, chooses the names of variables carefully and explains what each variable means. Not to be confused with Natural language programming.

Literate programs are written to be read by other software developers. These arbitrary explanatory phrases become precise new operators, created on the fly by the programmer, forming a meta-language on top of the underlying programming language. I was teaching classes and I was aware that people were using structured programming, but I hadn’t written a large computer program since The system, pbrt, is written using a programming methodology called literate programming that mixes prose describing the system with source code that implements it.

This approach was implemented at Stanford University as a part of research on algorithms and digital typography. A classic example of literate programming is the literate implementation of the standard Unix wc word counting program.