No, i am not kidding at all, but i may very well be blind. Then again, you just admitted to having to use Zope ... no wonder you have such a bad impression of HTML templating. ;)

However, i finally understand what you are arguing against. Perl grabs HTML which contains more Perl. But you know what? I don't think that is bad at all. In fact, i think it is wonderful! You seem to be more concerned with premature optimization than maintainability and readability. Yes, your way executes faster ... but does it even matter? Remember, the Internet is a Von Neumann Bottleneck. Who cares if your templates generate 5 seconds faster than mine if it takes 15 seconds to send them across the wire. And more imporantly, who cares if your templates generate faster than mine if it takes the HTML developer longer to understand how to even make changes, much less where to find what needs to be changed.

Besides, are tags like <tmpl_var>, <tmpl_if>, <tmpl_loop>, and <tmpl_include> really "code"? Well yes, but it is a very slimmed down code, now, isn't it? This isn't very much for an HTML designer to have to understand. Now, granted that Template Toolkit is much more complex and does allow for full out Perl code ... but i don't use it with a team. (And besides, Template Toolkit is FUN man! Don't you like to have fun coding?!?)

Listen. If it's just you or me that's handling the whole darned web site (coding and design) ... then pick whatever floats your boat. But if you are working with a team of HTML developers, i garuantee you that they will be more comfortable with:

<table> <TMPL_LOOP data> <tr> <td><TMPL_VAR foo></td> <td><TMPL_VAR bar></td> <td><TMPL_VAR baz></td> <td><TMPL_VAR foo></td> </tr> </TMPL_LOOP> </table>
than:

Um ... how the heck do you even do that with Text::Vpp?!? Nowhere in the docs is mention of how to use a FOREACH loop. Instead you have to delve through the undocumented test scripts and nowhere is an example of looping through a list of hashes. Also, nowhere is there a mention of using Text::Vpp to drive dynamic websites. This is really starting to look like the wrong tool for the job ... (and get this, the module hasn't even been updated in the past 2 years!)

Even the docs for Text::Vpp warn you against adding complexity to your code:


Adding Vpp syntax in your code will make it more
difficult to maintain. Even more so if the code maintainer
will not be yourself. Furthermore, the build procedure may
also be more complex. So please, do consider the trade-
off between speed and complexity.

Sure, the context is about using Text::Vpp to pre-process your code to gain speed, but again ... nothing about using Text::Vpp to drive dynamic websites. Now i start to really believe that this is not the right tool for the job. Please stop making me waste time on this pointless, pointless, pointless argument.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to 5Re: The scope of templates by jeffa
in thread I need a title - sucka! :-) by PetaMem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.