Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: What is your practice for code documentation? (Test::Synopsis)

by lodin (Hermit)
on Jun 27, 2008 at 19:37 UTC ( #694439=note: print w/replies, xml ) Need Help??


in reply to Re: What is your practice for code documentation?
in thread What is your practice for code documentation?

Indeed, the synopsis is extremely valuable. Unfortunately many people leave out a very important part: the result of the code displayed. In my modules I use the same format as I use on PM code examples:
CODE __END__ OUTPUT
For instance, the synopsis in List::Extract would be near useless if it wasn't for the output.

It's easy to generate (and manually test) this by simply typing perl -Mstrict -w and then pasting the code. On your screen you now have the code, __END__, and the output following that, ready to be copied back.

But the module may change, and an important feature of this format is that it's easy to test it. I've written, but not released, Test::Synopsis which extracts the code from the POD, compiles it, and if there were no errors or warnings, the output is compared to what's after __END__ (if anything).

It has proven to be useful to me. I'm considering it for release.

lodin

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://694439]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-01-27 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (71 votes). Check out past polls.

    Notices?