4 ms·
This is mostly just a complaint about how good React is. It's so good that it's difficult for the technical benefits of alternatives to outweigh the social bene
by tshaddox 1y ago
This is mostly just a complaint about how good React is. It's so good that it's difficult for the technical benefits of alternatives to outweigh the social benefits of choosing React.
Note that this is neither a major compliment to React's technical merits nor a criticism of React's competitors. In fact, I don't even disagree with the author on some of his claims, such as:
> React is no longer winning by technical merit. Today it is winning by default.
> That reflex creates a self-perpetuating cycle where network effects, rather than technical fit, decide architecture.
I agree! But teams are still largely choosing the better option, because the benefits of React are indeed outweighing the benefits of choosing an alternative. What the author is missing is simply that the technical benefits of an alternative are small except in narrow use cases. And I suspect most competent teams do in fact identify if they're in those narrow use cases and correctly choose an alternative.
- j45 1y agoReact is great at solving complex problems. Not all problems are complex to begin with, and having a complex tool as default otherwise adds complexity to the project and also inflexibility to iterate quickly. This is in addition to having to maintain a relatively brittle ecosystem from past feature as well as future features but that can be true for more than one area of JavaScript or other technologies. Looking for the next curve to emerge out of the current generation of web app building.
- throwaway-0001 1y agoAnd the moment you need to increase complexity in your app, you need to add back react.
- j45 1y agoMaybe, maybe not. It's not the only sponge, unless it's the only sponge I know.
- mickael-kerjean 1y agoI'm a counter example of your claim. Migrating away from React did made the complexity of my app a lot more manageable and unlocked new business opportunities that would have been impossible with React without following the JIRA route of making the software worse for 99% of users because 1% of those needed something. The project in question is Filestash (https://github.com/mickael-kerjean/filestash https://github.com/mickael-kerjean/filestash), what made me switch are those 2 reasons: - Performance ceiling. Past the point where you have used all the react specific optimisation tricks (useMemo, etc...), React just gets in the way, once you start to optimise things to reduce the memory footprint, optimise for 60FPS, dig into heap snapshots and allocation traces, your life starts to become miserable where you need a complete understanding of not only your app but also the inner working of React, and the intersection of both React with your app. At that point, you either accept the ceiling or rewrite everything to vanilla JS and have complete control over every piece of the code you are shipping to the client - Extensibility. I am now shipping plugins which patch frontend on the fly without any build step. In practice, after a plugin author packaged their plugin (as a zip file containing a manifest), the patches are applied in real time by the server without a prior frontend build system (open up the demo instance with the network tab open to see this working from: https://demo.filestash.app/ https://demo.filestash.app/). This powers themes with icons swaps, new behaviors (e.g. a "recall" button for files in Glacier), and other things plugin authors come up with that that makes the app far more customizable and opened for new niches without falling onto the JIRA trap
- throwaway-0001 1y agohttps://github.com/mickael-kerjean/filestash/blob/master/public/assets/pages/ctrl_connectpage.js https://github.com/mickael-kerjean/filestash/blob/master/pub... All using plain strings, what happens when you do a typo? Will your app will silently break or you’ll have a compile time error? that’s a huge draw back - in react I can get a compile time error for a typo most of the time
- mickael-kerjean 1y ago> using plain strings, what happens when you do a typo? The tests fails > Will your app will silently break or you’ll have a compile time error? There is no silent error. In practice, there are a couple fail safes: - using both eslint and tsc: https://github.com/mickael-kerjean/filestash/blob/master/public/package.json#L8-L9 https://github.com/mickael-kerjean/filestash/blob/master/pub... - the code is full of runtime assertions: https://github.com/mickael-kerjean/filestash/blob/1d1bad001b5e34f9712ee86412cf2c149a291efb/public/assets/lib/assert.js#L4 https://github.com/mickael-kerjean/filestash/blob/1d1bad001b... - unhandled error (like most assertion) will interrupt everything to show a scary looking screen: https://github.com/mickael-kerjean/filestash/blob/1d1bad001b5e34f9712ee86412cf2c149a291efb/public/assets/boot/ctrl_boot_frontoffice.js#L53-L54 https://github.com/mickael-kerjean/filestash/blob/1d1bad001b... - controlled error which are part of the regular error handling will stop the flow showing a screen like this: https://demo.filestash.app/?error=test https://demo.filestash.app/?error=test
- wk_end 1y agoI think (at least part of) the reason why React has been so successful is that is scales so well: it's actually a relatively simple tool that works well for small problems. Pair it with a Vite template or something and you can be up-and-running in minutes. But it continues working pretty well as your app gets bigger, too. But where React fails is actually in more complex scenarios. Prop drilling becomes tedious or intractable, so now we have all these different ways to manage state (Context, Redux, MobX, Recoil, Zustand, Jotai...). Your re-rendering gets slow, so now you need to start sprinkling React.memo() all over the place and adding reselect (or re-reselect!) queries and restructuring or denormalizing your store data, but then it turns out some of your props are objects that are regenerating each render cycle, so you need to memoize those too, and you end up on a wild goose chase there. Or your engineers were sloppy and accidentally put some side-effects into your components, so you've got subtle bugs you're not sure how to fix. And there's a lot of complexity or even unanswered questions around things like robustly fetching data your component needs, and maybe React Router answers them but then you end up down a whole other rabbit hole, especially when a new version of React Router comes out and breaks everything.
- solarkraft 1y agoThe amazing thing about React to me is that millions of dollars keep flowing into improving its DX further. They have spent a lot of time building React Compiler (https://react.dev/learn/react-compiler/introduction https://react.dev/learn/react-compiler/introduction) which does all the memoization for you! This severely lightens the performance concerns.
- paulhebert 1y agoSure, but Svelte and Vue have had these compilation features built-in for ages without all that money flowing in. The react team resisted these features because they went against their “it’s just a library” philosophy. They’re only copying them now because of how obviously useful they are in the other frameworks. useEffect, useMemo, useCallback etc. add a ton of complexity and make it easy to write buggy code. I used to work at an agency so I’ve done projects with React/Svelte/Vue/Lit/Stencil/Angular/etc. I found the React projects had lots more performance issues, confusing bugs, etc. than Vue or Svelte. I agree with the article. React is popular because it was groundbreaking and now is the default, but it’s far from the best
- sfn42 1y agoReact is totally fine for solving simple problems. I'd classify pretty much all frontend web development I do as simple. It's pretty much just boring internal websites, I definitely don't need react for them. Could have made the same thing with any other frontend framework, could have made it server-side rendered. React is totally fine for that. The backend is generally more exciting than the frontend. React is totally fine. The main problem I see is that most other developers are really ass at their jobs and just overcomplicate everything. I've seen very simple apps have a super complex React codebase, and due to the complexity they're always full of bugs. It's much more rare that I see an elegantly simple React app, or any other app for that matter. Everyone just always overcomplicates everything. Using React doesn't in any way require you to make it complex. You can make React apps dead simple. And if you are comfortable working with react you'll already know all the solutions to all the problems which makes your job extremely easy. You can breeze through and make the entire simple app in a few days if you know what you're doing. Or you can pick up some new fancy tool, hey let's try Svelte. And now instead of a few days we're gonna spend a few weeks and end up with a codebase that reflects our Svelte experience. And hey look it's time to onboard a new team member - hey guy, we have these three apps - this one's made with Angular because one dimwit wanted to learn that, here's a Svelte app we made last year and lastly here's a HTMX app we made when that was hot. Good luck learning 3 new technologies you'll probably never use again!
- FpUser 1y ago>"React is great at solving complex problems." The only thing it is great for is creating complex problems out of simple things.
- j45 1y agoHaha. I won't disagree with that - I have seen it used well and not well as well. Or people asking for "quick tweaks" not understanding that may not be a possibility depending on the programming that may have gone wild too soon.
- _heimdall 1y agoI have been a part of quite a few tech stack decisions at various companies and startups. I have literally never heard an argument made for react that included merits of the framework itself. The decision was always based on a combination for familiarity, ability to hire for eng roles, and the ecosystem.
- kamaal 1y agoIm not sure how this is a negative merit for React. Besides if you are a small company, or a start up, your job is to get things done. Not to embark on a global technology crusade to push your favourite tech. By and large the best thing about react is the overall ecosystem, libraries, talent and ubiquitousness. And thats a good thing.
- _heimdall 1y agoIt isn't necessarily a bad thing, but it doesn't align with the idea of how good react is or the technical merits of it. I also am not saying teams I have been on that picked react made the wrong choice. That's all in context and as you said startups are often in the "get things done" mentality where tech debt won't matter if you can't survive long enough for it to matter.
- tcoff91 1y agoIt’s good enough that the ecosystem outweighs the superiority of something like SolidJS. React has React Native as part of its ecosystem. That’s a massive advantage. react-strict-dom is going to be a game changer for the development of universal apps.
- _heimdall 1y agoWe're talking about two different topics here. I agree, the ecosystem around react is huge and there are reasons a team would pick react. Ecosystem isn't an indicator of the technical merits of react itself though, and that's what I was originally responding to here.
- sergiotapia 1y agoNever heard, "man react is great!" It's always, "we can hire more easily". Unfortunately
- nicce 1y ago> "we can hire more easily". Is this the synonym for cheaper workforce? You always get decent people if you pay enough.
- sergiotapia 1y agoI don't think so. I mean, if your code is Javascript you have 1000 applicants. If your code is Nim, you have maybe 10? That's how the beancounters think about it based on conversations I've had. So to please the beancounters you need to sell a technical decision so that it's technical merits massively outweigh those 1000 candidates.
- ggregoire 1y agoI can tell you I said "man react is great!" quite a few times 10 years ago when I tried it for the first time, after years of jQuery, backbone.js and Angular 1. Nowadays I still think it's great, but there is obviously no surprise and novelty about it being great since I use it every day. Like I'm sure you think toilets are a great thing but when was the last time you said "man toilets are great!"?
- iammrpayments 1y agoYou’re assuming webdevs are rational creatures which in my experience is far from truth, since they easily fall for human biases traps such as “social proof” and “authority”.
- rapsey 1y agoPretty much every social group falls prey to these biases. It has no correlation to the education or intelligence level of the group. When there is a well known saying "science progresses one funeral at a time" you know it is unavoidable.
- gitaarik 1y agoI think it's a bit of both. React introduced component based programming, wich was great. This was copied by many frameworks. But React held the first position because of it's strong base, and because it was just very nice and good in general for a long time in the first years of React, 12 years ago. But React has kept hold to the virtual DOM and JSX for over those 12 years. While other frameworks have created more innovative rendering mechanisms, resulting in faster rendering times with simpler code. So for the seasoned FE developer, they know there is better out there, but 9/10 jobs ask for React. And people don't seem to be interested in trying out some technology that is actually easier to use and results in a better end product. Because they are not familiar with the name, and they don't know anybody that made money with that, so better safe than sorry. So, React has been great, but by now it's a bit of a pain in the ass sometimes.