4 ms·
One thing I really like about literate programming even beyond the extensive "write about what you code" aspect is the availability of sub-procedural refinement
by mhd 15y ago
One thing I really like about literate programming even beyond the extensive "write about what you code" aspect is the availability of sub-procedural refinements. Quite often you write code where everything in a "paragraph" pertains to a specific matter, often preceded by a comment line saying so (e.g. "// Initializing database"). With literate tools I can just move that to a separate block and have a better overview. As this is mostly out of a poor need for visual organization, factoring everything out into small sub-routines and then taking care of scoping and passing needed parameters often seems like a crutch to me (especially in procedural code). Folding editors provide another option for this, of course. (Well, you also could use gotos. But no one ever did that. Especially not me. No, officer, never.)
If I remember correctly, I once had two C preprocessors that did just that, without the rest of the literate programming features. (Found a paper for one of these: http://page.mi.fu-berlin.de/prechelt/Biblio/refinement.pdf http://page.mi.fu-berlin.de/prechelt/Biblio/refinement.pdf)