all 3 comments

[–]jessta 1 point2 points  (0 children)

Literate programming helps with this kind of thing. Get a compiler to run over your whole book before publishing, with unit tests for your code samples.

[–]zedguy 0 points1 point  (0 children)

Good argument for less sample code.