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

I wonder why he chose Mako as a template system as opposed to Jinja (django style). Looking at the Mako syntax.. it just doesn't make any sense.


Django templates are designed to be designer (non-programmer) friendly, becase of its CMS/newspaper origins.

Mako's goal is to create a powerful, programmer friendly and FAST templating language .

A lot many times having code in templates is a faster way to develop, especially if the presentation layer is mostly intended to be used by a programmer.

Also, you can write mako code which has good separation of concerns.

How is : <% for r in rows %> ${r.name} <% endfor %>

less readable than :

{% for r in rows %} {{r.name}} {% endfor %}


jinja2 is as fast as mako. mako is popular, though, so I don't begrudge anyone choosing it as a default for a project.


jinja2 also lets you easily change your delimiters to make it suit your style, which is nice.


As it happens, I advised him on template choice; I recommended both Jinja2 and Mako, and he ended up choosing Mako because it supports embedded arbitrary Python blocks, and Jinja2 does not.




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

Search: