News for hackers. Stuff that matters.
Re:How I made a website with Svelte by BiteCode_dev on Saturday December 28, 2019 @03:44PM (#21901595)
In Vue it would be:

    <p v-for="(vars, i) in collection" :key="i">
      {{ vars }}
    </p>
Instead of:

    { collection.map((vars, i) => <p key={i}> {vars} </p> }
It's easier for me to picture what the first example is going to render because it makes the markup the hero, with code inside, while the second example is making JS the hero, with markup inside.

But this example is not even touching the topic. A render function is rarely that simple. Now if you do maps, and filters, and ternary operators, and && / || pass trougth, and set several class conditionally, and pass an event and do preventDefault, etc., now you have a more real life example. And in react you'll get __a lot__ of JS, with very little markup. And you'll have either a lot of boilerplate, or a lot of dependencies to get helpers.

While in Vue you'll get mostly markup, with a little code inside. It will read from top to bottom as well. No needs to wrap stuff in arrow functions to get the event object. PreventDefault has a helper. Setting classes as well. I prefer that.

Re:How I made a website with Svelte by Rapzid on Saturday December 28, 2019 @08:23PM (#21903168)
Vue's templates are great until they aren't, and then you wish you were using JSX.

The IDE tooling is worlds better with JSX as well. Vetur has.. had a rough year.

Re:How I made a website with Svelte by BiteCode_dev on Sunday December 29, 2019 @06:30AM (#21905375)
I don't have to debug my render functions much in vue because they contains little logic. Debugging is more common in JSX, it's better at solving a problem it introduces.
Re:How I made a website with Svelte by robertoandred on Saturday December 28, 2019 @09:22PM (#21903444)
The second example isn’t making JS the hero, it’s making data the hero.
Re:How I made a website with Svelte by BiteCode_dev on Sunday December 29, 2019 @06:28AM (#21905364)
Which is the opposite of what you want in rendering. Ui is king here. Data has the rest of the code to shine.