Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
The best reason to use any template language, in any system, is in the readability and functionality a template language brings.

Yes, your function is somewhat readable. Very much so. The problem is, it doesn't scale. For any HTML entity, any visual reference, it can affect another entity or reference. If I want to apply css, js and what not, I don't have a single document that contains everything in a single view. What's worse is, to find any particular piece, I have to go backwards and figure out what calls what. In a template, things are intended to be more flat - like a program w/ no user defined functions. Everything reads top down, loops get hit, variables get assigned an life goes on.

The intended target is also valuable. I can hand a template to a designer and state, "This is the syntax, be it simple like Html Tmplate, or Mason, tweak it so it's a horizontal scrolling page instead of vertical." Less things to break. The separation is nice because it is a controlled separation. Sure you can get around it, but it's fairly obvious when it gets complex. The reverse is true too. I can take an HTML file, and replace a mockup of a few rows into a loop quite easily, pass it back and ensure life is good.

In reply to Re: The hidden charm of Template::Toolkit (and templates generally) by exussum0
in thread The hidden charm of Template::Toolkit (and templates generally) by roman

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2023-09-25 19:13 GMT
Find Nodes?
    Voting Booth?

    No recent polls found