[cgiapp] strategies for decoupling HTML::Template

David Kaufman david at gigawatt.com
Mon Oct 22 15:30:52 EDT 2007


"Jason Purdy" <jason at journalistic.com> wrote:
>
> Late chime-in, but my vote: -1

(Not that this is a democracy, but...) I vote no, too :-)

HTML::Template, while it annoys me at times, is a small, fast and 
easy-to-install.  Therefore it is an entirely reasonable default templating 
engine, which you can easily replace.

Shipping CGI::App with *no* default templating engine would make it

  a) harder to install

(not easier, as the OP suggests) because new users whould then have to jump 
through the additional hoops of choosing and then installing a templating 
engine.  And the choosing would lead new users to threads full of religious 
templating flame-war debates such as this one, which just make choosing 
that much harder.

  b) less functional

CGI-App would then be missing one of the two design features which (IMO) 
have made it so successful in the first place: sane and painless templating 
(the other one being, of couse, sane and painless dispatching).

The mechanisms by which one chooses to author and populate one's templates, 
or define and call one's dispatched run-modes, are easily overridable and 
have been overiidden many times, in many ways by many people.  But each of 
those people adopted CGI-Application in the first place, I think, due to 
its ease of use.  And only decided to extend it after they become experts 
at using it.  So to me it's just silly to remove of of the strengths, 
thereby making it *harder* for new users to get started, just because some 
fraction of the expert users choose to override that feature.

  c) backwards incompatible

I'd have to update, like every web application I've written in the last six 
years, to make it work with the new version of C::A (which would make me a 
very unhappy camper).

HTML::Template is one pure-perl module file - If that prerequisite is so 
hard to live with, simply upload your fork to CPAN: 
CGI::ApplicationNoTemplates (or CGI::ApplicationMyTemplates).  Of course, 
then you'll have to port, or do without, the contributions of the rest of 
the community of C::A developers.  And who knows?  Maybe you're right! 
Maybe a community of developers who prefer to manually add a template 
engine to each of their CGI Applications will flock to your module.  Maybe 
it will be most of this community and the original C::A will waste away 
Mozilla-style while new users all adopt the fork, Firefox-style.

That's what open source is for, after all ;-)

-dave




More information about the cgiapp mailing list