Hacker News new | ask | show | jobs
by aliveupstairs 2280 days ago
I believe the templating is what's declarative, here. For instance, in Vue you can insert logic such as for loops, conditionals, event listeners, two-way data binding and so on right in the template with directives (HTML attributes).

    <Todo v-for="(todo, index) in Todos" :key="index"/>
Instead of an imperative JavaScript for loop.
2 comments

It is the same with handlebars. You put your todo element between {{#.}} and {{/.}} which means "do this for all elements" and then pass only the "Todos" array to the template. No loop in Javascript either.
How in seven hells is moving imperative loop constructs from Javascript to HTML supposed to be "declarative"?!

If anything, it's the opposite - you're now polluting HTML with imperative programming features where there previously were none.