For an example of what I mean, see underscore.js [1] and the prettyfied version of the source [2].
[1]: https://github.com/jashkenas/underscore/blob/master/undersco...
For an example of what I mean, see underscore.js [1] and the prettyfied version of the source [2].
[1]: https://github.com/jashkenas/underscore/blob/master/undersco...
That said, my critique: http://akkartik.name/post/literate-programming (I actually read many of the programs in OP to write that.)
Code can be presented in a way that best suits the reader (versus the writer or the compiler). Though Knuth's examples usually seem to dive right in, lacking the introduction to be provided by the latest stuff in TAOCP.
When I use it, I write it like a paper decorated with code, where the code can be extracted and run. I usually include the necessary make file and perhaps some test data. Entries in figures/tables are sometimes generated automatically by the program being described.
There are lots of old papers and critiques about LP, by Knuth and others. You should check 'em out.
So, a lot of complexity is added to a program just so that it can be understood and maintained in a formal language; but he also states that many modern comment styles go a long way towards literate programming.
Having worked on large codebases I concur that using literate programming to construct these seems far-fetched and too academic, yet I am enticed by the idea of optimizing code by literate programming since I have seen far too many abstractions for the purpose of maintaining easy to read code.