Literate programming in PHP?

Having come across mentions of it and seen pages of Knuth’s work, I became curious about literate programming. For those who have not come across it before, literate programming (LP) is an approach that mixes code in with extensive documentation to create something that is human readable and similar to a book.

So far I’ve encountered no instances of people using literate programming when writing PHP. Do you know of any?

3 comments ↓

#1 Jeff Moore on 04.12.06 at 4:41 pm

Any time you see code with PHPDoc comments, that is a tribute to Knuth’s literate programming.

#2 ikrabbe on 06.23.06 at 8:22 am

Though what is missing is a processing program for Knuth’s TeX files. To really produce book format. If you look at cweb’s output you will see what I mean.
It might be best to extend cweb to handle php code too.
I could do that job, but not without some donations, since I need to eat some pizza while coding this.

If interested, mail to ikrabbe . ask (at) web . de

bye ingo

#3 Don Huff on 05.15.08 at 12:04 am

My suggestion is that instead of Knuth’s weave that targets TeX, write the program to target HTML so the manuscript is written in English, HTML and PHP.

PHPDoc is an API documentation process not literate programming. This is something that you would want in your Eclipse or other IDE.

Leave a Comment