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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The main advantage of separating code according to the technology used is that different people can work on different parts without getting in each others' way.

HTML developers can change the templates and Perl coders can change the programming without having to deal with unfamiliar technology.

Inline code is fine if you are certain that all developers working on the project will be able to and have time to understand both the Perl and HTML. If there is any possibility that changes will be required in the future and you don't know who will make those changes, use a templating system. In practice, this happens on any successful project.

Separating the programming logic (model), the HTML (view) and the page generation code (controller) allows developers to specialise in their own areas, makes code more robust and gives you the flexibility to add new or multiple front-ends in the future.

Given how easy it is to incorporate something like Template::Toolkit or HTML::Template into your code, I can't see any reason not to. Typically, to create a template object, pass parameters, and output the HTML (or XML, or whatever you wish to output) takes less than 20 lines of code.


In reply to Re: Re: Re: OUTPUT: inline or template_based? by tomhukins
in thread OUTPUT: inline or template_based? by CodeHound

Title:
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found