Hacker News new | ask | show | jobs
by pier25 1686 days ago
Objectively, the Svelte example is cleaner and easier to read.
4 comments

The issue is not only the syntax, but the semantics. What happens to the scope when you nest #each expressions? Does it work with iterables (like for..of), or it behaves like for..in? I don't use Svelte, and I don't know those differences by reading the code. To me the nice thing about JSX is that is straight forward with JS semantics:

    const a = <div prop={expression()} />
is a DSL for:

   const a = factory('div', {prop: expression()}) 
is only a DSL to create tree structures (React is another story, you can use JSX without React).
Subjectively, I’d say. But since I agree that it’s cleaner and easier to read- I upvote you
By what metric are you measuring it objectively?
density.
Saying it is objective but not mentioning the reason really makes your statement subjective.