May 30, 2020   |   by admin

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: Mezikasa Gular
Country: Grenada
Language: English (Spanish)
Genre: Music
Published (Last): 23 April 2018
Pages: 70
PDF File Size: 16.48 Mb
ePub File Size: 15.87 Mb
ISBN: 207-6-61414-154-8
Downloads: 46369
Price: Free* [*Free Regsitration Required]
Uploader: Kinos

Besides demonstrating the techniques of clear, efficient coding, Knuth has sought to bring a deeper sense of aesthetics to the discipline. The number of lines in a file is The CWEAVE program is so named because it takes a given web and intertwines the TeX and C portions contained in each section, then it knits the whole fabric into a structured document.

Anything that is logically part of the section should be moved into it, thereby reducing the complexity of the code where it is referenced. Here are some software practices related to program documentation: These arbitrary explanatory phrases become precise new operators, created on the fly by the programmer, forming a meta-language on top of the underlying literafe language.

I don’t recall exactly the date now. A hierarchical structure is present, but the most important thing about a program programminh its structural relationships.

Literate Programming

No longer does the English commentary injected into a program have to be hidden in comment delimiters at the top of the file, or under procedure headings, or at the end of lines. Sections are presented in the order which is best for program comprehension.

Neither type of language can provide the best documentation by itself; but when both are appropriately combined, we obtain a system that is much more useful than either language separately. Re-think or knuthh code which is difficult to understand. From Wikipedia, the free encyclopedia.


This particular trick makes it possible to Indeed we believe that deep understanding of a small number of algorithms in this manner provides a stronger base for further study litwrate computer graphics than does a superficial understanding of many. For example, suppose that you want to define something like I had learned from a Belgian man I had met him a few years earlier, someone from Liegeand he had a system-it’s explained in my paper on literate programming.

The high-level language code and the system documentation of the program come from the same set of source files. 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”.

Literate programming

Each of these disciplines can materially improve programmer productivity and the quality of code produced. Of course, other computer scientists have made contributions to the field that are every bit as substantial most notably Edsger Dijkstra, Charles Hoare and Niklaus Wirth.

I may not be able to read your message until many months have gone by, because I’m working intensively on The Art of Computer Programming. This means that the document describing the program should consist of formatted text, rather than being a plain text file. So I was frightened with the idea that I would actually be expected to show someone my program.

Literate programming increases product quality by requiring software developers to examine programmihg explain their code. Despite roughness in low-level style, the program meets these goals well.


If we made these variables local to main, we would have to do this initialization explicitly; however, C globals are automatically zeroed. There should be no restrictions on the order in which the program fragments resulting from this decomposition are presented, so that this order can be chosen so as to obtain an optimal exposition; this may even involve bringing together fragments whose location in the actual program is quite unrelated, but which have some logical connection.

Tony Hoare was a great pioneer for proving the correctness of programs. The typographic processing of literate programs produces code listings with elegantly formatted documentation and source code.

Innovative ideas, critical technical knowledge, algorithmic solutions, and unusual coding constructions are clearly documented.

Knuth also claims that literate programming provides a first-rate documentation progeamming, which is not an add-on, but is grown naturally in the process of exposition of one’s thoughts during a program’s creation.

Knuth: Literate Programming

Wheeler, and Stanley Gill. In other words, the name of one macro can usefully be a parameter to another macro. Examine source code metrics lines, complexity, etc. The documenting power of such a simple device is remarkable. In some cases the result is so clear that there is hardly any need to supply further documentation; also it can sometimes be useful to use oiterate method to replace small pieces of somewhat cryptic code by a description that is actually longer than the code itself.

I discovered from reading some knuty the articles, you know, I could find three bugs in a program that was proved correct.