by Donald E. Knuth (Stanford, California: Center for the Study of Language and Literate programming is a methodology that combines a programming. Literate Programming (Lecture Notes) [Donald E. Knuth] on *FREE * shipping on qualifying offers. This anthology of essays from Donald Knuth, the. Christopher J. Van Wyk, Literate programming, Communications of the ACM, v n.7, E. Donald, Jill C. Knuth, TEX, Encyclopedia of Computer Science, 4th.

Author: Zulkree Douzahn
Country: Costa Rica
Language: English (Spanish)
Genre: Life
Published (Last): 10 October 2014
Pages: 225
PDF File Size: 11.58 Mb
ePub File Size: 16.34 Mb
ISBN: 550-7-39283-572-1
Downloads: 54428
Price: Free* [*Free Regsitration Required]
Uploader: Mikashicage

Making programs really big by duplicating efforts, and working around workarounds, using Java seems to “work” for strange values of workso perhaps this is a knhth thing? 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 and its associated comments.

In general, in many programs we can find algorithms that could be replaced by better ones such that no test cases break. Others have already given the reasons about the downsides of comments.

If Microsoft had made source files XML, tens of thousands of programmers would already be putting pictures and hyperlinks in their code. There’s at least one wiki that’s built on top of Git: Choices about architecture are hard to test in a unit-test sense, but are worth commenting on.

While Knuth may adorn his code with extremely illuminating prose, unfortunately the same is not true for many other programmers. The “notebook” paradigm in Mathematica is another good example; arguably it’s as much a part of the experience as the underlying Wolfram kernel.

Please send suggested corrections to knuth-bug cs. Journal of Statistical Software. 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: In order to understand that you need to understand what the domain layer is doing. That is to say: There’s also Gitit, which supports multiple VCSs including git: Keep it simple and straight forward as much as possible.

Literate programming

Many people adopted or invented independently this style of code structuring and commenting. Where did -2 come from? If it were not necessary for you or other developers to understand the code, then high level languages would not be needed. Knuth had privately used a literate programming system called DOC as early as Great documentation hits many purposes including lessening learning curve for training and behavior qualtitative verification without burdening readability by mindlessly duplicating boilerplate that detracts.


Writing the story after it’s done is too late – the business value is in the product’s shipped functionality, not in the development artifacts. If the choice isn’t testable in any way, it’s not worth commenting on. But then I also realized how much need there was for examples of good-sized programs, that could be considered as reasonable models, not just small programs.

I would agree with writing something code-friendly in the first place, examples of which would include DocBook and Restructured Text. The code section is a form of data reduction in that the section name is a placeholder representing the code contained in that section.

This is just me, but when I read through the literate programming book, and the hundred or so pages of literate code resulted in a program that could be replaced with a line of bash script, I decided that writing the program succinctly was more important than writing a novel to accompany it. This should include all aids such as mathematics and graphics that enhance communication of the problem statement and the understanding of its challenge.

This means that in the course of reading this book, you will read the full implementation of the pbrt rendering system, not just a high-level description of it.

It was over five years ago now. Moreover, who documents them in a pedagogical style that is easy to understand? Then, which is correct? Besides demonstrating the techniques of clear, efficient coding, Knuth has sought to bring a deeper sense of aesthetics to the discipline. If you’ve not worked with requirements like that, you might be surprised just how solid you can make the code when you know before touching the keyboard for the first time exactly what the finished product is meant to do.

Accuracy comes second, efficiency is third and ‘elegance’ is dead last. I always thought that people who cannot adequately express their thoughts are fundamentally unfit for any kind of programming anyway.


The usual reservation about additional tools applies: It’s for other people and also yourself in the future – I have certainly come back to my own code a year later and wondered what the hell I was doing.

It’s been called Roundtrip Engineering. Not every developer speaks English. Each of these disciplines can materially improve programmer productivity and the quality of code produced. It’s arguably ligerate really a fair use of the term “oral culture” either.

While modern languages like JavaScript or lisp ;- allow for a very free structure, and ordering of the code in accordance with how comments might fit, or the thought process that went into the design — that’s just proper programming style: He or she strives for a program that is comprehensible because its concepts have been introduced in an order that is best for human understanding, using a mixture of formal and informal methods that reinforce each other.

The subroutine itself may be placed anywhere in the store. Read your first page: Actually, literate programming uses a method that differs from this only trivially from a formal standpoint, but has a great advantage in practical terms: Porgramming, code cannot explain itself.

Note that I think they could do it, but that they think they cannot. In the first style, the program, stripping away documentation, is pretty much a working code as is.

Literate Programming

dona,d The documentation portion is often a verbal description of the algorithm. The style of literate programming combines source code and documentation into a single source file. In such cases, it can be worthwhile to carve out an knuh of tranquility, clear prose, and rigor, even if it means using slightly different tooling than the rest of the project.

Most real-world products face new requirements on a weekly, sometimes hourly basis; as a result, most fast-growing startups have oral cultures where the way to learn about the software is to ask the last person who worked on it.