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

I got used to React components, and after that templates feel a bit cumbersome and un-ergonomic in places.

I’ve been using Django templates since 2006. Jinja was designed after Django templates of that era, fixing their most glaring problems. Don’t remember the exact year when I started using Jinja a lot. Maybe 2013.

For example, a pure existence of an {% include %} tag. People use it, implicitly passing many arguments to some other template. Which makes it very hard to understand and change later.

Macros are not that pleasant to use, there are less features in macros then in Python functions, and tools support is much worse too (static analysis, formatting, etc).

Filters… why do I need to write `value|string` instead of `str(value)`?

Etc.



The benefit of filters is that they don’t share the namespace with the template context and I would argue are more readable.


Not sharing the same namespace is a benefit, I agree. Not a huge one, as I don’t name my variables “map”, “string” and similar anyway. And would not look favorably if any of my employees did that.




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

Search: