June 25, 2019 posted by

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: Malamuro Braramar
Country: Brunei Darussalam
Language: English (Spanish)
Genre: Medical
Published (Last): 22 July 2018
Pages: 335
PDF File Size: 16.18 Mb
ePub File Size: 7.4 Mb
ISBN: 438-8-78088-692-3
Downloads: 36906
Price: Free* [*Free Regsitration Required]
Uploader: Tojas

The program should be the most concise and clear description of what is going on.

He would pick a handful of requirements, and would then ask to see the complete chain from there; the breakdown of requirements from their level to the more functional level, the design that purported to meet those requirements, the code that implemented that design, the tests of that code, and then the tests of the original top-level requirements.

This means that the document describing the program should consist of formatted text, rather than being a plain text file. It’s to help them understand what you’ve done; a small amount of extra burden on you now to remove a large burden on other people in the future.

Most of what I see in this thread are just excuses, born out of either ignorance or laziness. The general problem with documentation is that it gets out of date as the software evolves to fit new requirements. If Microsoft had made source files XML, tens of thousands of programmers would already be putting pictures and hyperlinks in their code. The book “Implementing Elliptic Curve Cryptography” is another example. On the other hand, I like not using functions for code management.

I want functions to be used when a function is really needed.


Literate programming

Imagine a physics textbook that was “just the equations” without any surrounding text. In such cases, it can be worthwhile to carve out an island of tranquility, clear prose, and rigor, even if it means using slightly different tooling than the programmijg of the project. If there are simplifications available, I find the structure makes them visible.

It wasn’t an obstacle to getting it done; it forced me to do what I really always knew I should – think about the design, make sure it made sense. See my other big comment here somewhere; in that case, the majority of the code was written once, delivered, and will be in use for a few decades.

In litedate to do a good job explaining what a view does, you need to know what the controller is providing. EliRivers on Aug 16, My previous employer a subdivision of a global top ten defence company used literate programming. There are only few things that are efficient and pdogramming in the trenches.

Literate programming: Knuth is doing it wrong

When the text was munged, a beautiful pdf document containing all the code and all the commentary laid out in a sensible order was created for humans to read, and the source code was also created for the compiler to eat.

In my experience this style is a very good match for a literate programming. Note that I think they could do it, but that they think they cannot. Myrmornis on Aug 17, Please send suggested corrections to knuth-bug cs. Here are some software practices related to program documentation: It’s just a small example, but it is a way to tie commentary tightly with function, and allows for “Here’s what this code does”-comment — that can actually be used for testing.

The language you write in has been developed, at enormous expense, to allow you to express your logic, in a way that you, a human, can understand.


And good enough is what keeps many from using optimal practices. Nobody is going be around to remember that the strange block of code is there to handle Palm Pilots.

I think a better example of “evolved” or “modern” LP is python doctests[1]. As a mathematician, I see many adults, even programmers, fear math for no reason whatsoever.

Or rather, and this is important, optimal from one perspective, e. Frameworks just make it really hard to put, in one ligerate, everything necessary to explain a concern.

Both iPython notebooks and Rmarkdown are a sort of literate programming, although with the emphasis on the text more than the code. I was teaching classes and I was aware that people were using structured programming, but I hadn’t written a large computer program since In literate programming the emphasis is reversed.

Literate programming – Wikipedia

The whole concept of code sections, indeed structured programming, is to reduce the amount of text that must be read in order to determine what a piece of code is doing. The usual reservation about additional tools applies: Especially the last point in parentheses is crucial: That’s another story I can tell you about sometime.

It often feels a lot like just reversing the comments as literate-coffeescript seems to be. What’s important is that you don’t need any special tools to use this style in your comment if your language is flexible enough. That’s the way we write code today.