Keep It Simple, Stupid | |
PerlMonks |
Re^5: Here documents in blocks (why templates)by LanX (Saint) |
on Dec 20, 2020 at 19:41 UTC ( [id://11125507]=note: print w/replies, xml ) | Need Help?? |
You seem to think that templates are just about replacing variables. There are more techniques like "includes", were sub-templates are integrated which have sub-templates and so on. Or embedding programming code inside the HTML for loops or conditional snippets. And there is reusability, like hacking once a generic "table" template and applying it to different projects. I have to admit all of this can also be done with pure Perl and no regexing at all, thanks to it's flexibility. But a framework has a lot of benefits in a team, for instance I don't have teach my colleagues a bunch of best practices if there is already a well documented trail to do it. Separated HTML-code is not only easier to edit - if it's well done the browser can display it , my editor can highlight it properly and formatting, validation and indentation is easy. Last but not least, isolated HTML code can be handled by a web specialist without any knowledge of the controlling programming langue, much like SQL-Statements don't need expertise in Perl. That's the main idea of the MVC pattern. Example from another perspective ... You've spend much time criticizing the design of the monastery, but it's a monolithic framework in pure Perl written 20 years ago. We can't simply ask several design expert to overhaul the templates, because a lot of HTML is interspersed inside Perl code. (actually it's even much more complicated, because many people added parts in the past)
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|