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
|
|