News for hackers. Stuff that matters.
Re:Comparing Svelte and React by dan-robertson on Wednesday March 24, 2021 @08:04PM (#26574767)
I don’t think any of your arguments in favour of react are sufficient. JQuery had a huge number of libraries and could be used to make websites that worked. Angular was backed by Google who generally have more clout than Facebook. I think most comparisons would find that jQuery does not solve the same problems and that angular resembles the kind of steaming brown thing one might find behind a cow—and that’s before you consider backwards compatibility.

I would argue that react has some particular merits (for three the whole vdom based architecture, using jsx, and unidirectional data flow), that it was the first (widely known) framework with those merits, and that it has generally been backwards compatible or only required simple changes. I think these do a better job of explaining why react became popular and inertia explains why it is still popular.

Re:Comparing Svelte and React by nawgz on Wednesday March 24, 2021 @08:31PM (#26575018)
Your counter points don’t check out too much though?

> jQuery

Just not possible to compose, which makes full applications difficult. No answers for state management or such either, completely a different scope than frameworks

> Google more clout than FB

In some domains sure, but I’ve never understood how people don’t think FB are masters of UI. There is probably no org with more UI clout than FB, they built their own insanely adopted library after all while Google can barely force their own engineers to use Angular

React is also unquestionably the most JavaScript of the libraries, a component’s markup is such a thin abstraction around an object and maps perfectly to DOM trees and concepts, classes or functions or hooks are all using native JS concepts, explicitly typed typescript and react genuinely eliminates the need for all simple testing plus makes for a streamlined developer experience, and its concepts of lifecycles and composability introduce complexity but in my opinion in a clearly delineated and extremely powerful way

Also, as always I have to note this, the churn argument is completely overblown wrt React, each way of writing code still works or compiles, conceptually the lifecycle and state management never changed just its syntax, and npm has old versions for a reason. I run 2016 code in production today as an internal application for engineers, and I’ve seamlessly updated webpack and module versions while keeping the same code syntax.

Re:Comparing Svelte and React by axguscbklp on Wednesday March 24, 2021 @10:34PM (#26575926)
Oddly, despite the immense resources that Facebook has available, Facebook in a browser is slow and glitchy, especially after the most recent redesign.
Re:Comparing Svelte and React by nawgz on Thursday March 25, 2021 @12:09PM (#26582016)
I can't say I share that experience at all - I make quite an effort to avoid installing their invasive apps, always using the browser - but it's an interesting point
Re:Comparing Svelte and React by dzonga on Thursday March 25, 2021 @03:36PM (#26584449)
writing react apps in a proper way is hard, very hard. plenty of companies out there big and small can't do it. once you've a professional react dev, you easily recognize the react apps due to the subtle bugs. makes me miss my old team, where our big react app was actually performant.
Re:Comparing Svelte and React by nawgz on Thursday March 25, 2021 @05:28PM (#26585632)
Can you speak to these bugs? I personally don't agree that React apps impart any standard class of bugs, but maybe that's because Redux is actually the source of all these issues and I've avoided redux like the plague it is
Re:Comparing Svelte and React by dzonga on Wednesday March 31, 2021 @08:21AM (#26646257)
example app: airbnb when you get messages. click a message. and you'll see it will still have an indicator that you've a message, when you've none. airbnb guys are some of the best react guys out there even released open source libraries like enyzme etc. fact is no one can ever get the react thing right. don't get me started on facebook. plenty of bugs in their new app. But for some reason, instagram web is polished.
Re:Comparing Svelte and React by dzonga on Wednesday March 31, 2021 @08:22AM (#26646271)
nice point on pointing out the redux part. yeah most times it's the point of bugs - state mismatch etc.
Re:Comparing Svelte and React by danjac on Friday March 26, 2021 @09:04AM (#26591623)
If a framework/library is very hard to use correctly - even for people who are not only experts, but contributors - then that's a huge red flag against it.
Re:Comparing Svelte and React by nawgz on Saturday March 27, 2021 @05:06PM (#26605632)
Sure, but if massive amounts of people disagree with that take and think the library is strong, intuitive, and best-in-class, maybe someone is just struggling with understanding the structure of the library
Re:Comparing Svelte and React by alfonsodev on Wednesday March 24, 2021 @08:44PM (#26575142)
> that it was the first (widely known) framework with those merits

Yep, and my interpretation is that, that (the widely known part) happened because it was backed by Instagram first (if I recall correctly) and then Facebook.

And not to invalidate your point but to add another speculation on why React became more popular...

Yes, Angular was backed by Google, but not used in production in massively successful product as Facebook, or Instagram, and I remember also about writing Directives, Services and it wasn't very inviting for third party packages.

When react came out, I remember the selling point was "it's not a framework, it's a library", "it's the V of MVC" and I think that strategy also helped to let the community create all the other pieces, and long term have a richer ecosystem.