The CWEB System of Structured Documentation
www-cs-faculty.stanford.edu
The CWEB System of Structured Documentation
1–10 of 16 posts
Re: The CWEB System of Structured Documentation
#2While it is a way to document and compile your programs from a single file, it still contains the problem of where the story of a program should happen, and in keeping the documentation and code in line and up to date with each other.
It should also be understood that the documentation is for other programmers and not users, since the printout of the document includes the code in-line.
Re: The CWEB System of Structured Documentation
#3Re: The CWEB System of Structured Documentation
#4See also NOWEB, a system that developed the ideas of CWEB. Wrote my dissertation using it. https://www.cs.tufts.edu/~nr/noweb/
Re: The CWEB System of Structured Documentation
#5I studied CWEB when I did computer science in the early 1990s (eek!). While it is a way to document and compile your programs from a single file, it still contains the problem of where the story of a program should happen, and in keeping the documentation and code in line and up to date with each other. It should also be understood that the documentation is for other programmers and not users, since the printout of t…
It can be difficult, because the assumption is emphatically not that the reader in unfamiliar with the target language. To that end, much of the code you find in CWEB will still be using idioms of the target language. Can still be somewhat jarring if you are not expecting that.
Re: The CWEB System of Structured Documentation
#6I studied CWEB when I did computer science in the early 1990s (eek!). While it is a way to document and compile your programs from a single file, it still contains the problem of where the story of a program should happen, and in keeping the documentation and code in line and up to date with each other. It should also be understood that the documentation is for other programmers and not users, since the printout of t…
I think that underlines a major point, though. CWEB is specifically to document the program for reading. It is not user documentation. It is not a design document of the intent of the system. It is documentation of the code, specifically. It can be difficult, because the assumption is emphatically not that the reader in unfamiliar with the target language. To that end, much of the code you find in CWEB will still be…
Have used literate programming for a real-life freelance project a year ago. Am using it for both my private projects and current freelance projects.
The manual can be broken down into four parts or volumes depending on size:
I. User's Guide
II. User's Reference Manual
III. Maintainer's Guide
IV. Maintainer's Reference Manual
Don't get this wrong, updating the screenshots in the
User's Guide is annoying and a pain.
Over 60% of my time go into writing soft
documentation for the users.
This seems to be the best way to have hard evidence
of the gathered requirements.
It shows what the user actually faces.
The user stories write themselves.
This is the place to put assumptions and data-flow
requirements that the human being in front of the
tool has to know.
The customer last year loved it.Testing becomes easy. Just follow the pictures in the User's Guide. That's your checklist. In last year's project we immediatly found differences in using the application on iOS and Android, just because the customer was on iOS and could play around with everything immediatly [0]. The first working prototype was done in a week. Iteration was fast in a tight loop with the customer. Basically, live coding.
Source code, entity-relationship diagrams made with Dia diagram, data-flow diagrams and even some math typesetting go into the Maintainer's Guide. All those hairy assumptions forced upon you by third party libraries, external APIs, and external ABIs go in big fat red boxes. Ongoing maintenance check-lists, build steps, and deployment issues also live here.
LaTeX makes it look beautiful. It is, honestly, a joy to read and nice to look at. Just like with research papers decent pictures make it better.
The reference guides are basically lookup-tables. There can even be an index and a glossary.
The PDFs can even be stored in git(1). I know, I know, don't store binaries in git. But it archives the project well [1a,1b]. You already have the screenshots. You can pull old versions out. All the hidden footguns can be called out in the text.
"It is better to solve the right problem the wrong
way than the wrong problem the right way."
-- Richard Hamming as quoted by Doug McIlroy in
Eric Raymond's The Art of Unix Programming. [2]
[0] [James Hague: Documenting the Undocumentable](https://prog21.dadgum.com/161.html)[1a] [Archive Your Old Projects](https://arne.me/articles/archive-your-old-projects)
[1b] [Archive Your Old Projects (HN)](https://news.ycombinator.com/item?id=38239358)
[2] [Solving the right problem](https://www.catb.org/~esr/writings/taoup/html/ch01s04.html)
Re: The CWEB System of Structured Documentation
#7Re: The CWEB System of Structured Documentation
#8Re: The CWEB System of Structured Documentation
#9My favorite is nuweb https://nuweb.sourceforge.net/ which allows for LP in virtually any language and provides documentation in LaTeX. The main trade off being that with wide language support the code sections are as-is, without special formatting. Since mostly people write the code sections to their own tastes already this is not a significant problem.
Re: The CWEB System of Structured Documentation
#10Earlier quoted context omitted.
I think that underlines a major point, though. CWEB is specifically to document the program for reading. It is not user documentation. It is not a design document of the intent of the system. It is documentation of the code, specifically. It can be difficult, because the assumption is emphatically not that the reader in unfamiliar with the target language. To that end, much of the code you find in CWEB will still be…
Counter-example. Have used literate programming for a real-life freelance project a year ago. Am using it for both my private projects and current freelance projects. The manual can be broken down into four parts or volumes depending on size: I. User's Guide II. User's Reference Manual III. Maintainer's Guide IV. Maintainer's Reference Manual Don't get this wrong, updating the screenshots in the User's Guide is annoy…