Literate programming

Posted by Laila Puntel

Donald Knuth’s talk:

How have his ideas about literate programming been implemented today? What differences can you see between his vision and our current reality?

Donald Knuth through his talk promotes the idea of radical change in the coding style. He thinks that computer programming should be seeing as literature writing with the idea that is being write it for people so that means that it has to be presented it in a way that is understandable. According to his talk this approach presents the advantages of being a way for us to detect mistakes that could be made within the code, easily modify and maintain the code, and they can indeed be understood by human beings. He mentioned that we have different tools being written by different people (languages, styles, sources, etc) that are being used in a daily basis without registering the communication between these tools. The problem is that once you used all these tools is very difficult to explain to another person how did you do the work. Another interesting point of his talk is that with “literate programming” a lot of intermedia procedures (data analysis, processing, visualization, etc) that are being hired in our final research products (e.g. papers) would be detailed in a way that can be easily interpret. This allows us to improve the reproducibility of our research and also contribute to the general knowledge not only with our interpretation of the results. It would be so valuable for the academia to start building this concept of “literate programming” from the very beginning of a project to generate better interactions with collages and research community.

According to Knuth using literate programming we can get higher-quality programs, since we could know the thoughts from the programmers, making the mistakes more obvious. The final product allows authors to restart their own thought processes and or help other to built their own program adding more thoughts into it. This is in contrast whith wht we currently see, where traditional programmers will just post the documentation that shows the source code in a certain order of compaling. And there are a lot of assumptions that users might have to do to generate the actual final programs. Once literate programming is implemented, code can be easily debugged and maintained for further use.

Literate programming…

“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”

Although his idea sounds perfect to make literate programming a generalize rule, currently reality doesn’t seem to follow his approach at least from my understanding in a very extended way. One of the reason for his poorly adoption is the amount of time and effort to write the literate programming.