Live data from Hacker News

Introducing Svelte, and Comparing Svelte with React and Vue (2021)

joshcollinsworth.com

151–160 of 213 posts

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#151
post #3

I've worked with all three frameworks, but as a mostly single dev/engineer I very very much prefer Svelte because it lacks a lot of boilerplate that React has, and it's easier to think about than Vue's clunky way to write variables and functions. But I'm a "hacker type" and don't work in a large tech company. I haven't seen Svelte in any sort of "real tech companies", haven't seen it on job boards, and it doesn't see…

Depends on your needs. Personally I hate Svelte's data model and how it changes the semantics of your code by injecting state handling (it's a mental burden). If you are basically writing blogs or very simple content this is probably not a problem. Writing complex apps though I much prefer deterministic top-down data flow and not arbitrary reactivity.

If you hate React for some reason I'd consider SolidJS a much more principled framework.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#152

Earlier quoted context omitted.

It's a case of "Nobody ever got fired for choosing X"[0]. No one would blame you for choosing React for a major project / new startup, but someone could definitely poke holes in choosing Svelte ("theres no package for X", "it doesn't scale", "we can't find devs that know it", etc.) 0 - https://www.quora.com/What-does-the-phrase-Nobody-ever-got-f...

As for the "can't find devs that know it" problem, I'd suggest anyone reading this that Svelte is incredibly easy to pick up. Like I skimmed the docs in literally a few minutes, and was able to build out a reasonably sophisticated application almost immediately.

Without knowing your background or the app is not that useful of an insight.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#153
post #121

Earlier quoted context omitted.

It is just an initial value.

So ref is just a state variable with an initial value of 10? How do you mutate the variable/change the state?

No, $ref(10) will return a reactive object. And 10 will be the initial value of that object.

You use the object the same way you use a js variable.

let st = $ref(10)

st = st + 1 // update it and use it like if it was just "10"

But now, st is reactive.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#155

Earlier quoted context omitted.

As for the "can't find devs that know it" problem, I'd suggest anyone reading this that Svelte is incredibly easy to pick up. Like I skimmed the docs in literally a few minutes, and was able to build out a reasonably sophisticated application almost immediately.

Without knowing your background or the app is not that useful of an insight.

Fair enough. I do have a little over a decade of experience, so perhaps that gives my opinion some bias. But regardless of the app, the premise behind Svelte feels as close to native as you can possibly manage. If you know html/css/js, it really shouldn't be hard to pick up the basics.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#156
I'm still very skeptical of the random templating syntax, of the weird reactivity with gotchas and most of all, of two way databinding. Wasn't two way databinding one of the reasons we got react (and one of the reasons i bought into it) back when angular was the go-to? I feel like every time i try to use two-way-databinding it ends up in a jumbled unintelligible mess where I'm chasing mutations around... Personally, if I have to try out a new framework, I'll probably try out solid instead.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#157
I'm using Svelte/Sveltekit for a project with about 80 pages (as the designer conceives them -- there are repeated patterns of course... there might be 30-40 sveltekit pages, though some are fairly complex.)

It's been great.

I have no experience with Vue, but I'd rather not work more with react.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#158
post #104

Earlier quoted context omitted.

That can work relatively well for projects where there are a handful of engineers, but I wonder whether it doesn’t be some much harder as your team grows to 20+ engineers working in the same UI code base?

Frameworks does not help in this case any more than proper organization / structuring of code. It is as easy to fuck up your React app setup as it is plain code. Just make sure that overall architecture and process enforced and are designed by experienced person/s rather than hamsters.

What do you mean by “hamster”?

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#159
post #3

I've worked with all three frameworks, but as a mostly single dev/engineer I very very much prefer Svelte because it lacks a lot of boilerplate that React has, and it's easier to think about than Vue's clunky way to write variables and functions. But I'm a "hacker type" and don't work in a large tech company. I haven't seen Svelte in any sort of "real tech companies", haven't seen it on job boards, and it doesn't see…

Not a large company, but we did choose Svelte and are actively seeking hiring someone experienced with it.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#160

I'm still very skeptical of the random templating syntax, of the weird reactivity with gotchas and most of all, of two way databinding. Wasn't two way databinding one of the reasons we got react (and one of the reasons i bought into it) back when angular was the go-to? I feel like every time i try to use two-way-databinding it ends up in a jumbled unintelligible mess where I'm chasing mutations around... Personally,…

svelte’s 2 way data binding is only within a component, and actually is 1 way if you look at the compiled output. very different than say angular, and pretty much equivalent to what you manually write with setState calls.

this is such a common misconception i feel like we should put this in the FAQ somewhere. people are fixating on the wrong thing when they go “oh ho 2 way binding bad”. its local and its compiled away, its fine.

Post reply on HN