Preferences

seanwilson parent
> I tried this just recently in https://taeric.github.io/many_sums.html.

Literate programming seems fine for heavily algorithmic stuff when there's a lot of explaining to do compared to the amount of code and the code is linear, but I was more thinking about how it works for common web apps where it's lots of mundane code that criss-crosses between files.


taeric
My gut is that this is where it should shine, oddly. The appeal of literate programming is that you can reflow the code to how you want to explain it. As such, if you had to add a bit of code in several places for a reason that you can explain in a narrative, then literate programming should help.

I say oddly, as I don't think I've seen it done for common web apps. I suspect that is largely because frameworks have not been a stable foundation to build on in a long time?

I can't help but think the old templates of old were a hint in how it would have worked fine? Have a section of the literate code that outlines the general template of a file, and where the old "your code goes here" comments used to denote where you add your logic, is instead another section that you can discuss on its own. (Anyone else remember those templates? Were common in app builders, if I recall correctly.)

WillAdams
My current project for a while was in a state where it was necessary to keep code in 3 separate files:

- gcodepreview.py (gcpy) --- the Python functions and variables

- pygcodepreview.scad (pyscad) --- the Python functions wrapped in OpenSCAD

- gcodepreview.scad (gcpscad) --- OpenSCAD modules and variables

as explained in: https://github.com/WillAdams/gcodepreview/blob/main/gcodepre... and it worked quite well (far better than the tiled set of three text editor windows which I was using at first) and I find the ability to sequence the code for the separate files in a single master file very helpful.

This item has no comments currently.