2 ms·
I argue that (good) literate programming can make code literature. Your program is told as a sort of story and ought to contain background info, thought process
by beardog 3y ago
I argue that (good) literate programming can make code literature. Your program is told as a sort of story and ought to contain background info, thought processes, and rationale for decisions. Additionally macros can be used to reuse code at build ('tangle') time that your underlying language may not otherwise support.
For example if I have some constants i need throughout a python program, I might put it in something like constant.py during normal programming, but if I were literate programming I could have a section called "Program constants" and dive into each one, referencing them with macros throughout the program. You do have to be careful because the macros can make debugging confusing since you are now working with two languages instead of 1.
You can also put stuff that is irrelevant to humans out of the way of the most important stuff.
Example literate program for writing a virtual machine program (not my work): https://www.jmeiners.com/lc3-vm/ https://www.jmeiners.com/lc3-vm/