A template is as useful as any other programming abstraction. It's a seperation of roles. Form from content. What is the same from what is different.

If you have your basic web page with it's standard parts (head, top navbar, body, bottom) why type these things over and over again? Templates add power and flexibility. If your company goes from DumbWebStartup.com to DumbB2BStartup.com all you have to do is change a few variables. Granted CSS does in many ways simplify things, but a complex web portal is more than just the color of the background.

I generally seperate parts of a web site into content (nodes in PM), packaging (look and feel) and components (search boxes, nodelets, etc). Templates greatly facilitate the use of these parts by keeping each of them seperate. I can move my search box or my breadcrumb bar all over the place, or change the way it looks, or whatever, without worrying about how these changes will effect the content of my site.

(Added) A programming design pattern that is used as a template for these sort of designs is the Model-View-Controller.

()-()
 \"/
  `                                                   ` 

In reply to Re: Why use templates? by ignatz
in thread Why use templates? by BUU

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.