Live data from Hacker News

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

joshcollinsworth.com

161–170 of 213 posts

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

#161
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…

list of real tech companies using svelte:

https://twitter.com/sveltesociety/status/1260209026563858432...

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

#162
post #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 awa…

Thank you very much for the explanation! I agree with you that this information should be somewhere, especially seeing as I (mistakenly) thought that too, I probably would've had less of a knee-jerk reaction to it if I knew that it's effectively syntax sugar. I'm guessing I'm not the only one who has really bad memories of angular... Sorry for the misunderstanding!

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

#163

Earlier quoted context omitted.

Nope, dude at my job totally got "laid off" for choosing to write a feature in an ecommerce system in React. He had used it before at a previous job and was familiar with it. Problem was: - No one else in the team was familiar with React. - React did not play nice with the rest of the app and developer work flow. - It was huge and slow - He didn't know React as well as he thought he did and we had endless bugs. - He…

This should never happen, the developers should not choose whatever technology stack or components they want for their piece of code, that's how Frankenstein started. But getting fired is reasonable in this case.

Yeah, that's a little bit of the story that I left out - he also chose React without the normal team consensus on tech, so there was that, too.

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

#164

Earlier quoted context omitted.

This should never happen, the developers should not choose whatever technology stack or components they want for their piece of code, that's how Frankenstein started. But getting fired is reasonable in this case.

Agreed, but there must be more to this story that resulted in firing. You can't easily fire people for the issues listed here, at least in most civilized parts of the world.

I wish. West Coast of USA can fire you for a bad haircut.

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

#165

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.

I lost a non-trivial amount of time converting a vuejs app to svelte before getting blindsided by svelte not having basic error handling: https://github.com/sveltejs/svelte/issues/1096

Many types of errors that the equivalent vuejs/react app will show an error page and allow reporting to sentry for will result in an uncatchable halting (some may describe this as "freezing") and with no way to report this to a service like sentry.

This is unacceptable for a framework claiming to be production ready.

It's unclear to me if this has been fixed in the last year or two.

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

#166
post #160

Earlier quoted context omitted.

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 awa…

Thank you very much for the explanation! I agree with you that this information should be somewhere, especially seeing as I (mistakenly) thought that too, I probably would've had less of a knee-jerk reaction to it if I knew that it's effectively syntax sugar. I'm guessing I'm not the only one who has really bad memories of angular... Sorry for the misunderstanding!

yeah no worries it’s a very common superficial reaction! we just spend a lot of time explaining it:

https://twitter.com/rich_harris/status/1420214295242199041?s...

https://twitter.com/rich_harris/status/1147902393293688834?s...

https://www.swyx.io/svelte-why#two-way-binding

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

#167
I still think Vue (especially Vue 2) is the greatest of them all. I've worked professionally with Angular, React, and Vue. Each for several years. Vue is easily the winner for me with the syntax that closely matches native HTML and JS/TS and how it encourages clean separation of concerns and clean code. JSX/TSX is absolutely the worst for the latter, it's like the wild west. "But you don't have to write it that way" - yeah ok, but when you work in a large organization it's going to get written that way by your peers; good luck trying to stop it. Angular is just a clusterfuck of pipes and observables that require higher cognitive load to unravel when trying to understand a semi-complex block of code. Contrast with Vue where I can near instantly understand what it's trying to accomplish.

This shit right here - {#if } {:else} {/if} - is why Svelte is deterring me. For the love of god, can we stop coming up with weird custom syntax for templating code? This is one area where Angular also pisses me off: *ngIf for example is just as hideous. With Vue: v-if, v-else. You add it as an attribute to native html, it's dead simple. No weird symbols, no braces or other oddball shit I have to look up when I step away from it for a few months and come back. It just makes sense right away.

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

#168
post #72

Single file components like .svelte and .vue are nice at first glance. But I want typescript, eslint and prettier understand my code natively and not wrapped in custom syntax and smushed into one file that every tooling now has to support. Maybe it's finally time for someone to standardize this - even if just pointing at what vue & svelte already do - so every tooling can go ahead and support amalgams of filetypes in…

Shouldn't really be a problem - I've had reasonable syntax highlighting of markdown files with support for inline code-blocks in different languages for a while in (neo)vim.

Mixing languages/dsls in a single file shouldn't be a problem.

Should also work for things like in-line sql fragments for orms etc?

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

#169
post #103
post #72

Single file components like .svelte and .vue are nice at first glance. But I want typescript, eslint and prettier understand my code natively and not wrapped in custom syntax and smushed into one file that every tooling now has to support. Maybe it's finally time for someone to standardize this - even if just pointing at what vue & svelte already do - so every tooling can go ahead and support amalgams of filetypes in…

Funnily enough, IDEs a decade ago (more, even) solved this for PHP already, as even back then a lot of PHP was still HTML and PHP (and JS) intermixed in one file. It’s a shame we haven’t solved it properly in modern editors without having to rebuild the tooling over and over again for every new framework.

You just gave me flashbacks of the 3000+ lines .phtml files I was working on a few years back, definitely not the most pleasant experience I had as a developer.

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

#170

Earlier quoted context omitted.

I love the kitchen-sink and batteries included of Angular. It made our small team very productive on large projects. But I really dislike the separated component files convention. On the other hand, I love React single components but hate having to shop-around and piece together every basic platform feature.

"hate having to shop-around and piece together every basic platform feature." Can you elaborate on what you mean by this?

Say, you are making an app, and find yourself needing a router, state management library.

Angular: use inbuilt router and rxjs

Vue: use vue router and pinia

React: shop around third party libraries.

You can shop for alternatives for both angular and vue as well, but they have a first party solution. While react does not and will not have a first party solution for this and many other use cases

Post reply on HN