3 ms·
I have yet to see a template engine that has any practical advantages over conventional <%= stuff %> scriptlet style. Moving format logic out of your template
by wavephorm 15y ago
I have yet to see a template engine that has any practical advantages over conventional <%= stuff %> scriptlet style. Moving format logic out of your template into your controller always results an unmaintainable mess.
- LeafStorm 15y agoJinja2? http://jinja.pocoo.org/ http://jinja.pocoo.org/ A lot of template engines seem to either go for "FULL PROGRAMMING LANGUAGE POWER!" or "NO LOGIC! LOGIC IS EVIL!", but I've found that the sweet spot lies somewhere in the middle - you have enough power in the templates to do cool stuff without polluting your controllers, but it uses a language designed for templating and not a general purpose language shoehorned into HTML tags, and doesn't give you features you'll definitely never need.
- greghinch 15y agoHere here, the Django/Jinja model for templating is so much nicer than dealing with partials in every template
- bryanlarsen 15y agoIf you want to see a template engine that doesn't treat HTML as a dumb string, take a look at DRYML: http://cookbook.hobocentral.net/manual/dryml-guide http://cookbook.hobocentral.net/manual/dryml-guide
- RobertKohr 15y agoYep, that is why I use EJS myself. Coming from a PHP background probably biases me though. It is just easy to create an html template with inserted values an minimal control flow using the <%...%> style.