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 Programming is also the name of DonKnuth’s book (ISBN One speculation for the reason behind Knuth’s pushing of LP is that according to Stanford’s.

Author: Shale Sharamar
Country: Armenia
Language: English (Spanish)
Genre: Education
Published (Last): 14 January 2006
Pages: 213
PDF File Size: 2.83 Mb
ePub File Size: 4.87 Mb
ISBN: 536-1-50768-558-7
Downloads: 46497
Price: Free* [*Free Regsitration Required]
Uploader: Vira

Just being pedantic here, but the Bus Factor is something that a benevolent manager would like to increaseright? We wrote in objective-C, targeting Windows and Linux. Document source code using an API documentation standard doxygen. The time I spent on the documentation could have gone – from my current perspective – into making the code smaller and simpler.

Literate programming

On the flip side, I happen to be fanatical about good naming, which is easier if the code is more concrete than abstract. Your code was scripted like a play with stage blocking directions, sets, costumes, and musical accompanyment whereas the way I have most often worked has felt more like improv: This of course helps readers.

That’s another story I can tell you about sometime. 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. And finally, who ever provides commentary programmong the theory and design issues behind the code as they write the documentation?


Sections are presented in the order which is best for program comprehension. I don’t remember all the details of what I did, but: I find that literate programming is something of a code smell.

Literate Programming

Knuth’s expository gem will teach future readers about programming style and data structures, whether they use the code or not. From their documentation it sounds like it uses literate programming and would be a good resource. When the last order of the subroutine has been executed the machine proceeds to execute the order in the program that immediately follows. This book received the Productivity Award from Computer Language magazine,awarded to products that significantly increase programmer productivity.

By using this site, you agree to the Terms of Use and Privacy Policy. Tony Hoare was a great pioneer for proving the correctness of programs.

You’re essentially doing LP if you have enough high quality comments. It happens a lot when a new programmer joins a project that has some code written already. On the other hand, I like not using functions for code management.

For example, suppose that you want to define something like A bad product will threaten the existence of an organization. That is, one of the most important in-the-now useful parts of literate programming is implemented in a good-enough version, particularly with good naming conventions and decent commenting.


And no, I don’t have a dog in there literahe, not the least because I’ve never seen anyone use literate programming in the same building I was in. 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. And I assumed that you do it anyway, because there’s no real downside for this in many languages. Literate programming is really valuable but you only understand that once you really try it.

Knuth: Literate Programming

In our case it would disappear if not enforce by peer review. In I wrote my first structured program; it was fairly good sized-maybe, I nkuth know, 50, lines of code, something like that. But that would be true of any documentation.

If there are simplifications available, I find the structure makes them visible. If we made these variables local to main, we would have to do this initialization explicitly; however, C globals are automatically zeroed. Literate programming hasn’t “taken off” nkuth in the sense that few people are performing the type of tranquil and rigorous work it was made for.