On 11/13/2003 5:54 PM, Ovid wrote:
> --- Michael Carman <[EMAIL PROTECTED]> wrote:
>> Cosmetically, everything should look almost identical. Behind the scenes I've
>> pretty much gutted and rewritten everything. Most significantly, it no longer
>> requires (uses) the Template Toolkit.
>
> Out of curiosity, why did you remove Template Toolkit?

The overriding reason was that it gave me much better control over the output. I
felt like I was fighting with the template to get the results I wanted.

Another reason is that I had to read the entire source file into memory and
build up a data structure (with lots of preformatted data) before filling in the
template. Splitting up the formatting is awkward. The new structure doesn't do
that; and it allows me to read the source file line-by-line.

I think templates are the most useful when you want to allow multiple ways of
presenting the same data, or to have a non-programmer define the presentation.
The latter certainly doesn't apply here. If there were a way to make a single
backend (that organized the data to be reported) that could be used to fill in
multiple templates (e.g. both the text and HTML formats) I'd be more positive on
using them. Honestly, though, I don't see how it's possible. The data
organization is very simple, the bulk of the work is in the formatting
(particularly the markup for HTML).

Getting rid of a dependancy on a non-standard module was just a pleasant
side-effect.

I don't say any of this to criticize the Template Toolkit. I've never been too
excited over any templating system. I always find it much easier to do it all in
Perl.

I'm not sure what Paul will think of this -- the use of the templates was part
of his original design that I kept when I wrote the current HTML report. He may
not be happy with me for abandoning it now.

-mjc

Reply via email to