[pmwiki-users] Ingredients . . .

Patrick R. Michaud pmichaud at pobox.com
Sat Feb 4 10:16:32 CST 2006


On Sat, Feb 04, 2006 at 03:47:32PM +0000, Ben Wilson wrote:
> 
> That said, I've scripted a few recipes and tinkered with a few more.
> I've noticed certain bits of code are used repeatedly throughout
> various recipes. I would invite the community to cull through the code
> and find which routines are more commonly used and may be worth
> pulling out of individual recipes and turned into "ingredients." I
> think so doing would reduce the size of code, improve the authoring of
> new code, and produce more maintainable recipes overall.

More to the point, I'm willing to pull any commonly-used
routines directly into the core.  If PmWiki itself doesn't
need them, they could still be placed into a 'scripts/ingredients.php'
file that recipes could rely upon and use.

> Authoring New Code: When you already have certain tried-and-true
> methods for doing certain things, piecing them together to make
> something different is all the easier. 

FWIW, we've done this at least once before -- the ParseArgs() 
routine was built because there were a large number of recipes that
needed to do argument parsing in directives and other places,
and so it made sense to create a single reliable routine than
to have everyone create their own.

So, by all means, let's identify common routines.  If they're
reasonable enough for the core distribution I'll add them, if not
then we can maintain a separate cookbook page or section for them
(similar to what we do now with skins).

Pm




More information about the pmwiki-users mailing list