So, I used the scribble/lp module to write my first literate program using plt-scheme:
#lang scribble/lp
(require scribble/lp)
<<lp_scheme.ss>>
@chunk[<squarefunction>
(define (f x)
(* x x))]
Nothing useful there, of course. Now I am sort of wondering why would I just not use plain comments, instead of literate programming constructs. Any opinions welcome. It would be really great if some one who have probably had more exposure/exp. with it to possibly give a more intuitive explanation of the differences between well documented code and code written using Literate programming constructs.
(I'm assuming you're using Donald Knuth's definition of literate programming.)
The key difference is one of sequence.
In writing a regular application, there are restrictions on the order in which you express things.
To illustrate:
With literate programming you are freed from this restriction and freed up to express your concepts in whichever order makes sense for you to use when explaining the program to another developer.
This has another consequence - in some forms, you can express a concept once (say, "All properties will fire the PropertyChanged event when changed"), and have that woven throughout your application in a myriad of other places.
For very simple programs, a literate program and a well commented one might look the same - but as the complexity of the system grows, the two will start to appear very different.