Howardism Musings from my Awakening Dementia
My collected thoughts flamed by hubris
Home PageSend Comment

Literate Programming Examples

I've really become enamored with the idea of literate programming, but figured that the best way to re-introduce it to others is the same way Knuth did… with examples.

What does it look like to work this way?

Here are a few screenshots of my Emacs environment showing some of these examples.

Now on to the examples. Keep in mind that each example below has an original "ORG" file as well as derivative files:

Tangling and Weaving Results

Coin Kata

Many people have talked about the Coin Change Kata, as a way to practice our coding craft. I thought it would be fun to try it in a literate way, and this is the results. I suggest viewing the web page first.

coin-kata.org
coin-kata.html     coin-kata.clj
coin-kata-tests.clj

Why yes, you can keep your tests next to your code and tangle it out to separate file(s).

Diary Template

Every day, I create a new file and enter information about my day… a quantified self diary if you will. I keep statistics like the weather and my diet to see what may trigger my infrequent migraines.

diary-template.org
diary-template.html     diary-template.sh

Emacs Init File

Being a rabid Emacs user, my .emacs file grows regularly, and sometimes I forget how some of the code I've added works… or even why I added it in the first place. LP and Org (with its abilities to have clickable hyperlinks) seemed a natural fit.

dot-emacs.org
dot-emacs.html     .emacs
Tell others about this article:
Click here to submit this page to Stumble It