Re^2: Templating system choice
by Bod (Parson) on Dec 21, 2020 at 11:03 UTC
|
Thanks hippo. It does seem to me that, whilst Template is powerful and does many things, the documentation is quite clear. Having read the tutorial last evening, I am quite sure I could make it do something useful today.
Unlike Mojolicious, Template seems more general purpose and not specifically intended for web deployment.
Template is also already installed on my shared hosting :)
| [reply] |
|
|
Template::Toolkit (TT) is the most powerful templating language in Perl; well, maybe it’s really Mason, but that is a digression. It’s not necessarily a good thing.
My POV: I love and use Template and have for 15ish years. I don’t use it for new projects. It is complex enough that it becomes a mini-language, so you’re not really doing Perl and you’re not really handing off templates to designers or non-coders that they will be able to understand and edit. It can easily make a clean MVC design into spaghetti soup by embedding all three elements in templates.
Also TT is extremely slow compared to something like Text::Xslate. Xslate has the benefit of being a more pure View. It’s got a few affordances but it doesn’t really rise to the level of mini-language. If you’re using Mojo, its templates might be a better idea than TT.
The only clear advantage I see in learning TT is that many legacy projects use it, so it might be nice to know when job hunting.
| [reply] |
|
|
| [reply] |
|
|
|
|
|
|
|
|
| [reply] |
|
|
|
|
The only clear advantage I see in learning TT is that many legacy projects use it, so it might be nice to know when job hunting
It's nearly 2 decades since I was job hunting. I've worked for myself for long enough to know that I don't ever want to work for anyone else again - now things are the other way around as I employ people and have to cope with those challenges instead...
I love and use Template and have for 15ish years. I don’t use it for new projects.
This seems strange to me...
If you love Template and presumably you are very familiar with it from the time you have spent using it, why would you not use it for new projects?
| [reply] |
|
|
|
|
|
|
Also TT is extremely slow compared to something like Text::Xslate. Xslate has the benefit of being a more pure View.
Having looked at the documentation for Text::Xslate I see that it is "a template engine, tuned for persistent applications". As I rarely write persistent, or at least persistent applications with enough output to warrant a template, this is probably not the one for my needs.
Also Template Toolkit seems to have more extensive and clearer documentation and examples. These cover areas beyond just HTML. Web development is just a part of my coding so I think this is where I am going to start. It has also been around long enough that several Monks have become familiar with it so I can hopefully get the guidance I need when I inevitably get stuck 😊
| [reply] |
|
|
| [reply] |
Re^2: Templating system choice
by Bod (Parson) on Dec 29, 2020 at 00:12 UTC
|
I am happy with Template and would choose it again if starting from scratch because it has everything I need with very few downsides
This evening I've made a start with Template and it was easier to get something working than I expected. It all just seems to fit together nicely.
Thanks hippo and everyone else who directed me down the templating path.
| [reply] |