Literate Programming with Org Mode

Justin Worthe had a nice addition to the articles on literate programming and Org mode. It is, I think, a pretty balanced treatment of the benefits and disadvantages of literate programming. On the one hand you have the usual advantages of integrated documentation that goes beyond source code comments. That can yield large benefits for the programmers who end up maintaining the code and even for the original author 6 months later. There is also, as Worthe points out, the related field of reproducible research, which is I think, the premier application of the literate programming idea.

On the other hand there is the tricky matter of collaboration. It’s certainly the case that literate programming works best—or at least is easiest—for individual efforts but most work isn’t like that so it’s important to take collaboration into account. The problem is that engineers and scientists are fussy about their tools and it’s likely that the team members don’t agree on what those tools should be. That’s especially true when you’re talking about Emacs and Org mode.

Worthe has some suggestions about solving the collaboration problem but none of them are wholly satisfactory. The best suggestion is to use something like CWEB or NOWEB but they don’t have the same excellent tooling as Org mode and, of course, CWEB requires you to be working in C. For example, I could never warm up to CWEB but Org mode with code blocks seems natural to me and offers the same advantages.

For a large number of problems, literate programming can be a real win but it’s not without its challenges.

This entry was posted in General and tagged , , . Bookmark the permalink.