3 ms·
IMHO Jinja was never worth salvaging. It's a bandaid for not being able to mix Python and HTML easily. Super slow parsing. Unintuitive DSL (opinionated enough
by geenat 2y ago
IMHO Jinja was never worth salvaging. It's a bandaid for not being able to mix Python and HTML easily.
Super slow parsing. Unintuitive DSL (opinionated enough to be a PITA). Huge LoC vs the value it contributes to your project.
Adopt a different system.. see: ERB, PHP, EJS- all of these are extremely fast and intuitive (just the native language + an extra tag or two).
Edit:
Of course.. this is authored by the jinja guy.
- krick 2y agoExcept no cultured adult programmer would use the original PHP syntax for templating, unless it's some 5-minutes worth development script. It's too powerful and too complicated. People use smarty or twig, which are basically the same thing as Jinja.
- lyu07282 2y agoI always liked TAL, it kind of made sense to me that the templating engine itself understands the syntax of the language you are templating. It ought to be impossible to write invalid HTML/XML. It's like the pain you get into when templating YAML with jinja, but if the YAML template also were itself a valid YAML file it would be much cleaner imho.
- the_mitsuhiko 2y agoI don't disagree but we ended up with systems like Jinja because that's what people adopted. I also built GHRML which was a syntax aware template engine for generating XHTML documents and it never really took off. Sometimes it's the simple and dumb solutions that win out over the cleaner stuff. Nowadays maybe less so, JSX clearly won and if you build UIs today that's probably what you should go for. However there were many solutions like JSX a long time before and somehow the value proposition was not right for the software written at the time.