Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Jinja2? 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.


Here here, the Django/Jinja model for templating is so much nicer than dealing with partials in every template


If 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


Yep, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: