back

by dochtman·16y ago·view on hn ↗
I don't care for it. Jinja is pretty much the last word in Python templating, IMO.
2 comments
I think this is an unfair comment. Weby templates are a different approach to Jinja (which is a conventional templating language) and its like comparing apples and oranges.

Automatically generating HTML from code has many advantages (and some huge disadvantages) compared conventional templating but has been used as far back as Perl's CGI.pm with many different lisp libraries also doing the same.

If you have never used such a library I'd recommend giving it a try sometime - they're very nice in situations such as automatically generating forms or database search results (where conventional templating gets challenged) which have more display logic than HTML.

I don't think it's comparing apples to oranges. While they take different approaches, they have the same end result, and in a given project, you would probably only use one.
Apples and oranges are just different approaches to getting the nutrients one needs. It seems like an apt comparison. Whether the normal usage of "apples and oranges" is sensible is a different matter.
I'd appreciate it if you tried and use it a bit and then give me feedback on what is difficult to learn because it is overly esoteric or specifically what you could not do.

Some advantages are that it integrates more cleanly into Python code, the templates end up being smaller, you get guaranteed closed tags, and it has a significantly smaller API and thus it is easier to learn while being quite powerful (very Pythonic). It does all this without compromising on speed, legibility, or power.