Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

611–620 of 866 posts

Re: React is winning by default and slowing innovation

#611
post #453
post #439

I'm not a front end dev and only use JS stuff time to time for small personal project. There is so much JS framework out there that appear and disappear so fast. I don't know if we can call it innovation. I have the impression they just reinvent the wheel with so little value added. I prefer to keep on React at least it will not disappear the next time I will do some change on my project.

My pet theory is that frontend devs have so little on the critical path, and are usually overqualified for the kind of work they do, that they keep reinventing these interesting paradigms for managing state in GUIs basically just so they can keep themselves entertained.

You are giving most front end devs way too much credit. Most just use React because that's what they were taught and see it as an end rather than as a means to an end as if it is an accomplishment.

Computers have become faster while websites have become slower. You can go on a random webpage and usually see 100s of MBs of memory being used while we had computers in the 90s running 3D games with around 1/100 of that. LLMs have partly become popular because people don't want to enter the current wasteland of web pages who couldn't care less what framework you used and just want to get what they are looking for and to get out.

You will see people write things like "powered by React" as if React is doing any thing except running more JS. You are not getting any closer to the CPU or any of your hardware that actually runs your machine.

At best some of these front-end devs want to appear as if their job is far more complicated and sophisticated than it is.

Re: React is winning by default and slowing innovation

#612
post #472

React isn’t just "winning by default" It's winning because at the core it's just JavaScript function composition. A component is a function, conditionals are `if (...) { ... } else { ... }`, loops are `map()`. JSX is just sugar for function calls. In Svelte you are writing XML with little JavaScript islands inside it. Instead of if you get `{#if}{:else}{/if}`. Thats not "ergonomic" – thats a mini-language stapled on…

So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? Because it sure looks like the former even though it compiles to the latter. React isn't Javascript. It's a franken-language that looks superficially like a mix of JavaScript and XML whilst following the rules of neither. That's why there is such a thing as a React compiler - a good sign that you're not writing JS, which doesn't have compilers.…

JSX isn't and hasn't even been necessary to use React. The first version of my company's site didn't have a build step and called createElement manually.

And in the decade I've been writing for React, I've never used the React compiler. But saying that it's proof that it's not JavaScript it's like saying that V8 is proof that JavaScript is too complicated because otherwise it would be fast enough not to need a JIT.

And all those rules? You don't have to follow them either. Use class components. They're still there, and they work fine.

Re: React is winning by default and slowing innovation

#613
back in 2015s we had to choose from react, angular and emberjs and we chose the worst one , emberjs. My primary rule now is if lots of people are using after the hype, it should be sth. I also tried vue and react seemed much more understandable for a backend guy like me.

Re: React is winning by default and slowing innovation

#615

Earlier quoted context omitted.

This is the first time I've seen someone argue that adding syntactic sugar means creating a new language.

it really depends on how much syntactic sugar you add. You could go back 13 years, show somebody some JSX and ask them what language they think it is and nobody would be well that's obviously JavaScript with a bit of sugar on top.

Sure, if I'd been replying to a comment that had anything resembling nuance, that would be applicable.

It did not.

Re: React is winning by default and slowing innovation

#616
I've written a fair bit of React and dipped in and out of Vue, Solid and Svelte over the past few years - I like to check in with different frameworks periodically, call it curiosity or FOMO. The general sentiment of the article is that React is old and slow compared to Solid/Svelte etc. While that's true, how many apps really need to squeeze that extra performance out of their underlying framework? Not many, I'd guess. For example, the ubiquitous krausest benchmark tests [0] operate on thousands of rows and the margins in results are shrinking - just today I noticed that the latest alpha from Vue has made huge strides forward.

React cannot iterate as quickly as other, smaller frameworks because of its size, but I guess that could also be seen as a positive thing. Even so, things like the React compiler are clawing back performance, taking cues from Solid, Svelte et al and these frameworks become more alike all the time.

For me the choice comes down to how I reason about the code I write. As others have pointed out, React feels closer to metal than Svelte - I find it easier to reason about because there's less magic going on behind the scenes. I really want to like Svelte, but I just can't click with it at all and I find the documentation lacking in deep, 'under the hood' detail.

On the flipside, I find Solid's docs to be superb - in depth articles on their reasoning, differences to React, etc [1][2]

On the whole, though, I find all these frameworks to be pretty good and what you can build is unlikely to be hamstrung by your choice in any way; though of course, React has a huge community behind it that you can't ignore. For hobby projects, try them all out - I had not worked with Vue 3 at all until recently, I just picked it up to try making a drum machine with the lovely Elementary [3] DSP library and I am really enjoying it! I hope we continue to see lots of development of all these frameworks and new ones pop up, because it's very clear to see how they all feed off one another, and that's good for everyone.

Shout out to Alpine.js [4] which flunks those benchmarks every time but remains my go-to for sprinkling reactivity in 'regular' websites.

[0] https://krausest.github.io/js-framework-benchmark/ [1] https://docs.solidjs.com/concepts/intro-to-reactivity [2] https://docs.solidjs.com/advanced-concepts/fine-grained-reac... [3] https://www.elementary.audio/ [4] https://alpinejs.dev/

Re: React is winning by default and slowing innovation

#617

Earlier quoted context omitted.

> So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? It would be best to think of it as syntax sugar for create Element() function calls. You enter JSX with angle tags and insert expressions in braces > React is full of magic syntax that looks like functions, but e.g. you can't call them inside an if statement, or you have to redundantly declare the 'dependencies' (variables you read) and so on…

> It would be best to think of it as syntax sugar for create Element() function calls Thats what makes it a new language. C is just sugar on top of assembly. Its so strange that jsx needs a buildstep, but misses ton of obvious ergonomics that one could have added. Why className instead of class? With a buildstep, it would surely be possible to determine if class was a keyword or not based on context

Syntax sugar is language syntax that improves a common pattern from the language (making it sweater). jsx, async/await - things that just abstract common patterns.

Re: React is winning by default and slowing innovation

#618

Earlier quoted context omitted.

No OP, but I've also used Angular, React, Vue, Solid and Svelte in real world projects and my default choice is Vue, because it's on par with Solid and Svelte (and with Vue Vapor those three are basically the same) but with the larger ecosystem (vuerouter, vueuse, nuxt, nuxt-ui, primevue, nuxt-content, ...). I must also say that React was by far the most unpleasant and unproductive to use.

I keep reading unpleasant without any arguments. React is simple by nature, what made it unpleasant and unproductive? Granted I mostly do work on Shopify apps, so most of the heavy work has been done for me, I just put components together. This works fine, and I'd rather do this in React than e.g. Angular due to the small scale of the apps. Then again web components would've also been fine.

Perhaps "simple by nature" is not at the top of everyone's mind. Simple is great until you build something complex, or need to create a large reactive UI that is not a simple CRUD fetcher. Things like non-linear video editors, 3d editors, games, things with a large component tree that takes work to plan, build, and non-trivial to re-arrange thereafter.

Your "simple by nature" framework with one-way binding and render-the-whole-tree-when-something-changes now means you spend more time coding (fighting) React than you do your application logic. You could have focused on improving algorithms, but nah you're stuck architecting hooks, context providers, state management, and adding libraries that cement you deep into the React hole.

I think React developers all secretly want to use Solid but they're stuck using React at work, and just chant React is the best React is the best React is the best

Re: React is winning by default and slowing innovation

#619

Earlier quoted context omitted.

So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? Because it sure looks like the former even though it compiles to the latter. React isn't Javascript. It's a franken-language that looks superficially like a mix of JavaScript and XML whilst following the rules of neither. That's why there is such a thing as a React compiler - a good sign that you're not writing JS, which doesn't have compilers.…

> So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? It would be best to think of it as syntax sugar for create Element() function calls. You enter JSX with angle tags and insert expressions in braces > React is full of magic syntax that looks like functions, but e.g. you can't call them inside an if statement, or you have to redundantly declare the 'dependencies' (variables you read) and so on…

Hooks are magic syntax without any doubt. All magic syntax is made up of non-magic parts, that's kinda the point.

The way you know it's magic is it shatters the principle of referential identity, which tells you that a variable is itself. It pretends you can use a simpler mental model but you really cannot and must not.

Re: React is winning by default and slowing innovation

#620
post #472

React isn’t just "winning by default" It's winning because at the core it's just JavaScript function composition. A component is a function, conditionals are `if (...) { ... } else { ... }`, loops are `map()`. JSX is just sugar for function calls. In Svelte you are writing XML with little JavaScript islands inside it. Instead of if you get `{#if}{:else}{/if}`. Thats not "ergonomic" – thats a mini-language stapled on…

Please. Let’s get real about the biggest issue with Svelte/Vue/Solid: it wasn’t written by Meta, and had no chance at the clout game that is essential for mindshare.

(Not saying React is bad, just that DSLs impeding adoption rings hollow in light of Tailwind/JSX.)

Post reply on HN