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 .
|Published (Last):||24 June 2018|
|PDF File Size:||3.34 Mb|
|ePub File Size:||2.96 Mb|
|Price:||Free* [*Free Regsitration Required]|
Scattered proggramming amongst the program code are comments which describe the various parts of the code. But Knuth is concerned not only with bytes and microseconds, but with a concept that has come to be known in coding circles as “elegance,” and that applies to programming at any prgoramming.
The high-level language code and the system documentation of the program come from the same set of source files. Conduct peer reviews of deliverables. Literate programming is NOT about documentation in the first place.
Knuth: Literate Programming
This book presents a selection of modern rendering algorithms through the documented source code for a complete rendering system. Hoare had heard rumors about my work and he wrote to Stanford suggesting that I keep publication in mind. If we express a program as a web of ideas, we can emphasize programmig structural properties in a natural and satisfying way.
The literate programming metalanguage provides two important features.
Tony Hoare was a great pioneer for proving the correctness of programs. Numbers like P68 and Q78 in this list refer to the corresponding papers in my list of publications. The meta-language capabilities of literate programming are also claimed to facilitate thinking, giving a higher “bird’s eye view” of the code and increasing the number of concepts the mind can successfully retain and process.
The most obvious and natural way to do this is to suppress the program text for those inner levels, leaving an outline of the outer level, while the inner levels may be specified and documented elsewhere; this is a bit like introducing subroutines for the inner levels, but without the semantic implications that that would have. The unraveling of the chunks can be done in any place in the literate program text file, not necessarily 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.
The documentation and high-level language code are complementary and should address the same elements of the algorithms being written. You totally missed the idea, and in the case of blind leading the blind quote scores of other misreaders. 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.
This book is a long literate program. Develop small classes and small functions when feasible. Let us change our traditional attitude to the construction of programs: The first published literate programming environment was WEBintroduced by Donald Knuth in for his TeX typesetting system; it uses Pascal as its underlying programming language and TeX for typesetting of the documentation. We understand a complicated system by understanding its simple parts, and by understanding the simple relations between those parts and their immediate neighbors.
Retrieved January 4, Long procedures are restructuring by folding portions of the code into sections.
Literate programming: Knuth is doing it wrong
All of that is here in the pages that follow. Instead, it is wrenched into the daylight and made the main focus. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. This approach was implemented at Stanford University as a part of research on algorithms and digital typography.
The grand totals must be initialized to zero at the beginning of the program.
Execute static analysis for common coding errors. Establish structures, processes, and outcomes see Luke Lkterate. 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. Such exposition of ideas creates the flow of thought that is like a literary work.
Examine source code metrics lines, complexity, etc. 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. Literate programming increases product quality by requiring software developers to examine and explain their code. The documentation should include a description of the problem and its solution.
The first is the ability to mix prose with source code. Applicability of the concept to programming on a large scale, that of commercial-grade programs, is proven by an edition of TeX code as a literate program.