4 ms·
I straight up prefer templating for ergonomic reasons, especially when I see someone inlining higher order functions & JS control flow structures in a HTML DSL.
by akst 10y ago
I straight up prefer templating for ergonomic reasons, especially when I see someone inlining higher order functions & JS control flow structures in a HTML DSL.
But I can sympathise with where you're coming from, as I have not so fond memories of backbone + [insert templating library]. A lot the problems can be addressed through better tools & a pre compilation stage where the templates are transformed into JS & data input are escaped for security reasons. One example of this is Ember.js's HTMLbars which address basically all of what you just listed there.
edit: That said if for whatever reason I couldn't use Ember, I'd probably choose some flavour of JSX over most other templating libraries, lol