@mkennedy you've mentioned a few times you prefer chameleon to jinja2. What's the benefit in your opinion? Also, what about partials love when using htmx?
@mkennedy thanks for your examples. The difference is subtle, but I think I see what you are saying. I had a typo in my second question. I meant to ask- can you still do partials with chameleon or does it have some other feature that makes htmx work?
The very clear difference is you can write arbitrary Python code in Jinja. That should never be done but it is encouraged.
Chameleon only allows a very small subset: string output, if statements, and loops. That’s it. So you are required to write better Python code. I think ironically this is why it’s less popular. :)
@djotaku Templates. Compare how much python gets mixed into the HTML here? This is both very cluttered, error prone, encourages writing more python here where it absolutely does not belong, and it’s not valid HTML.
@djotaku It’s night and day to me. Jinja is a very poor language if you care about separations of concern, sharing html with non-python devs (e.g. designer), etc. To be somewhat fair, almost all other template languages are like Jinja, not Chameleon.
Add comment