3 ms·
Yes, this is probably the wrongest statement. When React was launched, it was one in a pool of thousands of web frameworks. For any axis you want to claim that
by johnfn 1y ago
Yes, this is probably the wrongest statement. When React was launched, it was one in a pool of thousands of web frameworks. For any axis you want to claim that React won by "default", there was another framework that dominated React in that axis and lost anyways. Some frameworks had more resources and lost (Angular), some of which were more popular and lost (jQuery, Backbone), and some of which were even more hyped than React and lost (remember Meteor?).
React didn't win by default, it won because developers tried it and found it was better. It absolutely won on technical merit.
There's a bit of a question of whether React would still win on technical merit today, versus all the next-generation frameworks. I personally think it is still better than Svelte, Vue, etc, but I'm a bit of a React apologist.
- ipaddr 1y agoIt won by marketing and the angularjs to Angular breaking change. If they kept going with angularjs or had an upgrade path react wouldn't be default in the enterprise stack. That's all on Google. Meteor was node framework. jQuery is probably still more popular but it is only a lib. Vue had a Chinese language problem. React won because a framework by Facebook felt safe.
- johnfn 1y agoIf every other framework failed because of <insert reason here>, that does indeed sound like React won due to its own merits.
- ipaddr 1y agoMerits yes technical merits no. Products rarely win because of technical merits. Products win with marketing. Technical merits can add another layer to the marketing but without facebook's brand people would still be on angular.
- johnfn 1y agoIt's unclear to me that Facebook's 'brand' is superior to Google. Google has plenty of popular, successful open source projects. If Facebook's brand was all that was needed for it to crush Google, wouldn't Pytorch be crushing Tensorflow right now?
- ipaddr 1y agoWe are talking about a different time and different market. Google had the top brand overall back then but just in terms of frontend frameworks their brand became mud and no one trusted them after they spent the last year or two moving into angularjs and now they needed to rewrite everything. So they rewrote what they had in React instead of AngularJS. Facebook had the more trusted brand over Google and other frameworks.
- oofbey 1y agoGoogle's incapable of sticking to anything good. Nobody gets promoted at Google maintaining a system. So somebody inevitably gets the idea to make a 2.0 which isn't backwards compatible, enabling them to do all sorts of bold promotion-worthy innovation. And inevitably 2.0 isn't very good. Even worse, it makes the entire ecosystem confusing and unhealthy.
- rmunn 1y agoUpvoted despite your final sentence being incorrect. :-) You're absolutely right that React is miles better than Angular, but Svelte and Vue (which feel very similar to each other, I just switched from one project written in Svelte to a different project written in Vue and a lot of my knowledge is carrying over) are quite a lot easier than React. When I write in React I have to think about the hooks and when I'm initializing them; when I write in Svelte or Vue the $state/ref() systems just work and I don't have to think about them. I can even initialize a $state inside an if block if I need to; I admit I'm no React expert, so I should ask you. If you needed to create a piece of state inside an if block in React, how would you do it? Is the only answer "Move the hook call outside the if block, and just don't use it if the if block doesn't run"?
- machiaweliczny 1y agoThat someone can initialize a state in if block is not something good. React won with Angular 1.0 because noobs abused two-way binding making fking mess everywhere. Now in react they abuse useEffect but it’s a bit easier to control. I work currently in Svelte and never use 2-way binding and are careful to package state mgmt well but I like it. It’s similar to react with mobx but more performant although has no good component libraries. SvelteKit is also generally fine
- johnfn 1y agoWe'd probably have to talk about it IRL; the question you're asking kind of implies you're coming at the whole thing from the wrong direction, and so any answer I give would be unsatisfying unless I could somehow transfer the entire philosophy in my head to you. The short answer is that what you're asking doesn't really make sense to me. I think of the lifetime of state as analogous to member variables of a class. In the same way that member variables in a class are always visible to the entire class, a state variable in React is always visible to the entire component. You wouldn't want it to be scoped to an if block any more than you'd want a member variable to be scoped to an if block. Maybe now you're thinking "well, that's limited in an annoying way, and Svelte is better". Maybe. But I suspect for any problem that exists that you think needs conditionally-scoped state, there's a nice clean solution in React. That's what I suspect, anyways. But I very rarely run into problems in React that I can't express in nice, clean code.
- Izkata 1y ago> some of which were more popular and lost (jQuery, Backbone) Don't forget about having a migration path. I don't know how common it was (or how messy it might be, I never did this myself), but before Redux became popular, people were using Backbone models as the datastore for React. So existing Backbone-based apps had a way to piecemeal migrate to React.