|
|
|
|
|
by smt88
4087 days ago
|
|
I used to think PHP was good for templating, but then I learned about code-less templating engines like Jinja, and I'll never go back. When you use a templating engine, you can change the backend entirely without messing with the template. You can also compile/optimize the display of data in the template more easily. Some awesome person has made a Jinja2 lib that comes with Rust bindings, which looks cool (though I haven't tried it yet): https://github.com/jroweboy/jinja2-c |
|
To be fair, all that you can do with a templating engine you can do "natively" as well. You can for example have code-less templates in PHP if you are disciplined enough to keep it that way. The only thing template engines do is enforce not being able to shoot yourself in the feet, but it's not an absolute must if you know what you are doing.