in reply to Re^2: Hierarchy of code reuse by flexibility
in thread Hierarchy of code reuse by flexibility

Please note that the synopsis sections of CPAN modules are not code - they are documentation that has the form of code.

They only become code if you use something like Pod::Snippets to actually turn it into code.

And as useful as they are, I found that they already are a maintenance burden, and I'd prefer a non-copy-and-paste way to assemble them, if possible. (So far I haven't found one, but I also admit that I didn't look all that close).

  • Comment on Re^3: Hierarchy of code reuse by flexibility

Replies are listed 'Best First'.
Re^4: Hierarchy of code reuse by flexibility
by zby (Vicar) on Feb 17, 2009 at 11:21 UTC
    You can call it documentation - but it is reuse of the ideas of the author. This may make the title of my medidation not quite correct - but these are just word-plays - what is important is the big picture of reuse.

    Pod::Snippets is very interesting here - it is about having examples with tests. I believe this is a powerful idea. There are many modules at CPAN that are really just examples with thests. For example there are modules that 'adopt' something to use with Catalyst, but they don't really give any new functionality just rename things - and make sure that they work with Catalyst. I don't like the result - it adds another redirection layer that does nothing, and often even restricts the original interface. If it was presented as an example with tests users would get all the benefits with none of these disadvantages.