April 5, 2019 posted by

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: Totilar Dar
Country: Botswana
Language: English (Spanish)
Genre: Finance
Published (Last): 17 February 2013
Pages: 451
PDF File Size: 2.88 Mb
ePub File Size: 5.60 Mb
ISBN: 293-2-79947-469-5
Downloads: 59709
Price: Free* [*Free Regsitration Required]
Uploader: Malkis

We look at each character and change state if it begins or ends a word. This book is an anthology of essays including my early papers on related topics such as structured programming, as well programminb the article in The Computer Journal that launched Literate Programming itself. Besides demonstrating the techniques of clear, efficient coding, Knuth has sought to bring a deeper sense of aesthetics to the discipline.

At best, a professor might publish very small routines as examples of how to write a program. Literate literwte is a programming paradigm introduced by Donald Knuth in which a program is given as an explanation of the program logic in a natural language, such as English, interspersed with snippets of macros and traditional source code, from which a compilable source code can be generated.

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 effect of this simple shift of emphasis can be so profound as to change one’s whole approach to programming. The documentation for a literate program is produced as part of writing the program. The documenting power of such a simple device is remarkable. For example, suppose that you want to define something like This proggramming course helps readers.

That example was the key to me for this idea of thinking of a program as hypertext, as we would now say it.

Then we had a student at Stanford whose name was Zabala-actually he’s from Spain and he has two names-but we call him Inaki; Ignacio is his name. Despite roughness in low-level style, the program meets these goals well.

Knuth: Literate Programming

Knuth says that when he realized this, he began to think of a program as a web of various parts. The typesetting language enables all of the comprehension aids available in books such as pictures, diagrams, figures, tables, formatted equations, bibliographic references, table of contents, and index.


This book received the Productivity Award from Computer Language magazine,awarded to products that literaate increase programmer productivity. Hanson demonstrates that “literate programming” is a viable approach to creating literatte of craft as well as works of art.

So I was frightened with the idea that I would actually be expected to show someone my program. The documentation should include a description of the problem and its solution.

And we could polish those until The first is the ability to mix prose with source code.

Literate programming

It should be an unusual but not exceptional case when a module contains no documentation. Document source code using an API documentation standard doxygen. The literate program should have logical subdivisions.

Instead of comments provided as side notes to source code a literate program contains the explanation of concepts on each level, with lower level concepts deferred to their appropriate place, which allows for better communication of thought. Knnuth may be any textual information that aids the understanding of the problem. Nkuth Microsoft had made source files XML, tens of thousands of programmers would already be putting pictures and hyperlinks in their code. In other words, the name of one macro can usefully be a parameter to another macro.

This gave me some experience with writing a program that was fairly easy to read. From the programming language point of view the most obvious method of identification would be to use identifiers, resulting in a simple system of parameter-less macros, with as only unusual aspect that uses of the macro are allowed to precede the definition, and indeed do so more often than not. This approach was implemented at Stanford University as a part of research on algorithms and digital typography.

Literate Programming in WEB”. There are many factors involved in developing excellent software. We understand a complicated system by understanding its simple parts, and by understanding the simple relations between those parts and their immediate neighbors.

Program comprehension is a key activity during corrective and perfective maintenance. The philosophy behind CWEB is that an experienced system programmer, who wants to provide the best possible documentation of his or her software products, needs two things simultaneously: The presentation is engaging and clear. Instead, it is wrenched into the daylight and made the main focus.

Related Posts (10)  LIBROSWEB XHTML PDF

This may seem like a trivial change, but in fact literate programming is quite different from other ways of structuring software systems. They liteerate programs from computer science textbooks rather than listings from executable programs. The key features of literate programming are the organization of source code into small sections and the production of a book quality program listing.

Conduct peer reviews of deliverables. Literate programming Computer-related introductions in Literate programming progrmaming first introduced by Donald E. Cross references, indices, and different fonts for text, high-level language keywords, variable names, and literals should be reasonably automatic and obvious in the source and the documentation.

I use the following list of requirements to imply a definition of a literate program and the minimum set of tools which are needed to prepare, use, and study the resulting code. Literate programming is useful for programs of all sizes. This differs from traditional documentation, in which a programmer is presented with source code that follows a compiler-imposed order, and must decipher the thought process behind the program from the code literatr its associated comments.

The reader is forewarned to not mix up the holon concept with the “module” one. It is designed so that when its task is finished it returns control to the master routine at a point immediately following that from which it was called in.

Retrieved January 4, Literate programming is just a single technique to be used along with all the other well established software engineering practices. The main idea is to treat a program as a piece of literature, addressed to human beings rather than to a computer.

Functions are decomposed into several sections. A classic example of literate programming is the literate implementation of the standard Unix wc proyramming counting program. A complex piece of software consists of simple parts and simple relations between those parts; the programmer’s task is to state those parts and those relationships, in whatever order is best for litegate comprehension not in some rigidly determined order like top-down or bottom-up.