Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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.

Readability: only if you have a high ratio of static/dynamic code; functionality: only if restricting is a benefit.

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.

What do you mean by 'scaling'? A template doesn't save you from "entities affecting each other". You have a single document only in the case of trivial pages with sparse dynamic content. If you have e.g. inclusions (of other templates), reading gets equally difficult, an you have to go back to look where each bit comes from.

And if you have a different language, e.g. that of Template::Toolkit, you have to go back to the calling code to see what every token means.

[% INCLUDE debugtxt msg="file: $" %]
Quick, was is info here? A hash key, a method, function, something else?


_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re^2: The hidden charm of Template::Toolkit (and templates generally) by shmem
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: (3)
As of 2023-09-25 19:46 GMT
Find Nodes?
    Voting Booth?

    No recent polls found