Literate programming is writing out the program logic in a human language with included (separated by a primitive markup) code snippets and macros. - [Wikipedia](https://en.wikipedia.org/wiki/Literate_programming)
From: https://rmd4sci.njtierney.com/why-rmarkdown.html
### Literate Programming as a Solution for Reproducibility
> The idea of literate programming shines some light on this dark area of science. This is an idea from [Donald Knuth](https://en.wikipedia.org/wiki/Donald_Knuth) where you combine your text with your code output to create a document. This is a _blend_ of your literature (**text**), and your programming (**code**), to create something that you can read from top to bottom. Imagine your paper - the introduction, methods, results, discussion, and conclusion, and all the bits of code that make each section. With rmarkdown, you can see all the pieces of your data analysis all together.
>This was a popular idea, and it has had some interesting discussion and contributions over the years. Notably, in the R ecosystem, the _Sweave_ (S+weave) program provided a way to write text and code together. As with any technology, there were some speedbumps with using Sweave, and some of the reasons we are not teaching it now is because:
> - It uses a form of LaTeX, which provides great flexibility at the cost of complexity.
> - Printing figures involves additional work
> - There isn’t a way to save (cache) your work. Every analysis has to be repeated from start to finish. This was time consuming.
***
2023 cloudedknowledge.net