Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Thanks for this writeup. I have been planning to embark on writing a templating system myself, so it was enjoyable to get to read a war story.

The first writeup I ever posted to PerlMonks was about a templating system I thought I should write, and had I embarked on it then, I would have followed the same journey as you have, and certainly with less success. I thought I should because all these template systems I found very so complex and full of features and so much slower than something like

s{ %% (\w+) (?: \s* || \s? \s*? (.+?) )? %% } { defined $var{ $1 } ? $var{ $1 } : $2 || '' }g;

(which is roughly what I was using – simple variable substitution with optional default values). I can only chuckle at my naïvete now… teehee. Of course the systems are all “bloated” – they start as simple schemes that can cover only stiflingly modest needs and invariably follow the same progression towards comprehensiveness.

Now, several years down the line, I know a lot more. It’s reassuring to read your account and find that I’ve contemplated every single point you mentioned. (It goes without saying that my design decisions differ greatly from what you describe, and also from everything found on CPAN – else why would I be thinking about it?) I might still be too lazy to do it; which is OK, in the big picture: CPAN isn’t terribly in need of another one of those… :-)

Makeshifts last the longest.


In reply to Re: The history of a templating engine by Aristotle
in thread The history of a templating engine by jimt

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (12)
    As of 2014-12-26 12:54 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (171 votes), past polls