3 ms·
> Edit: Why spread the ugliness of "endif" and "endblock"? Why not just "end"? Why have the unnatural "elif" as well? Not the developer but I did not remove en
by the_mitsuhiko 11y ago
> Edit: Why spread the ugliness of "endif" and "endblock"? Why not just "end"? Why have the unnatural "elif" as well?
Not the developer but I did not remove endif for twig or jinja either coming from Django. Reasons for it: it becomes a lot more readable in the templates and it avoids lots of debug headache due to accidentally deleting things. It's already hard enough to debug template code sometimes but this way at least it's very quickly clear what the problem is.
What would you use instead of elif? `{% else if %}` is in no way nicer than `{% elif %}`. I picked `elif` in Jinja because it's what Python uses and that's where Jinja is at home.