Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

741–750 of 866 posts

Re: React is winning by default and slowing innovation

#741

Earlier quoted context omitted.

I remember seeing Mint quite a few years ago. I love the idea, I really like the language design, but I agree 100% with your take on the drawback. It's hard to sell that to teams. What's surprising to me is how many alternatives exist in this space. Between elm, imba, svelte, and mint, and probably more that I don't know about, I wonder how many devs in the world are shipping to prod using them. edit: have you though…

> have you thought about including Form Validation to the core lib? There is a module for that in the standard library ( https://mint-lang.com/api/Validation ). Moving the functionality into the language level is intriguing.

I meant to say more than validation, something like this feature set:

https://www.react-hook-form.com

React Hook Form is beastly.

Re: React is winning by default and slowing innovation

#742

Earlier quoted context omitted.

Angular: Where is the code for the component that is used here? Anywhere in the codebase, maybe defined multiple times, depending on module configuration one or another may be used. Good luck finding which one. React: Where is the code for the component that is used here? Either defined in the same file or imported, like any other javascript thing. But React is the crazy one.

In modern day Angular, everything is standalone, so the module issue doesn't apply. I've been coding in Angular since 2 and I have never had a duplicate component with the same name. Almost every Angular app uses nearly the same folder structure.

Good that they fixed the module obsession. And it would be better if they also fixed the other part of the problem.

Re: React is winning by default and slowing innovation

#743

Earlier quoted context omitted.

Javascript has warts, React has warts, Svelte has warts, Python has warts... It's easy to shoot yourself in the foot in any tech - it's leaky abstractions all the way down after all. useEffect usage needs to die, yes. I don't think it's a case against React, given its age. Otherwise, using React is straightforward. I started coding in it without reading any docs. As someone who used Dojo, prototype, ext.js, jQuery (+…

A child who hasn't tasted other mom's food always say, my mom is the best cook in the world. You saying you can be productive in react is just ironic. I just read it as, I can be employable using React.

Bro lists like 8 different moms whose food he has, then says he likes react-moms food, and you make it sound like that's the only thing he's ever had. Did you even read the comment you replied to?

Re: React is winning by default and slowing innovation

#744

Earlier quoted context omitted.

That way of using it is so different to how you're supposed to use that it might as well not be React at all. It was designed as an in-browser framework and is poorly designed for server-side template rendering.

React has always done SSR first and then hydrated state on the client. What leads you to believe that this is not how you're supposed to use it? Doing pure SSR with React is simply... do not hyrdrate state on the client. Really really straightforward. This is such a vanilla setup and was kind of the big selling point to start with from the get-go? Why do you claim otherwise?

This is factully wrong. You are confusing react with nextjs. React produce html documents, and the first usecase was reactdom, a pure client rendering library.

Re: React is winning by default and slowing innovation

#746

Earlier quoted context omitted.

Fair. My bitching would've been better expressed as "I groan every single time I attempt to violate a hook rule." Which is a lot, because I'm new to React. It's almost certainly a "skill issue", but hooks are NOT just "JavaScript functions", contrary to React marketing PR. My conditional beef: in my app, users can choose between using the built-in mic for speech recognition or a 3rd party service (LiveKit). If the us…

You don't have to use their hooks! Looking at your pastebin link, I would probably opt for something like a factory pattern instead: https://pastebin.com/PbnBqX4a Just because you're in React land doesn't mean you can't still write regular old js/ts and hook in only when you need it. I imagine you'd do something quite similar in any other framework.

I appreciate your example.

Some libs do not expose "vanilla" js/ts functions that I can call - e.g. `LiveKitRoom` https://github.com/livekit/client-sdk-react-native

It only takes 1 hook to pollute your entire factory pattern; the comparison to colored async functions wasn't spurious. Hook-only options seem especially prevalent in the React Native ecosystem (ironic, given the memory constraints of phones).

Of course, I could fork/go down to the native layer, but this just proves my point that React DX is hot garbage.

Re: React is winning by default and slowing innovation

#747

Earlier quoted context omitted.

React has always done SSR first and then hydrated state on the client. What leads you to believe that this is not how you're supposed to use it? Doing pure SSR with React is simply... do not hyrdrate state on the client. Really really straightforward. This is such a vanilla setup and was kind of the big selling point to start with from the get-go? Why do you claim otherwise?

This is factully wrong. You are confusing react with nextjs. React produce html documents, and the first usecase was reactdom, a pure client rendering library.

No. I'm speaking from experience having used React from its very first release. You're not only factually wrong about me being wrong, your knowledge is obviously quite limited.

React has always initially rendering components on the server, then hydrated on the client. You don't have to take my word for it, download the initial release and try it out yourself: https://github.com/facebook/react/releases/tag/v0.4.0

Go ahead, run that and write a simple app. Even better, want to do full SSR with no client lifecycle? Write an app that uses "React.renderComponentToString" and then describe what's happening for me.

Even .NET had solutions around using React just for SSR: https://reactjs.net/features/server-side-rendering.html

Claiming that react itself could not just render out a component server-side and spit out the HTML to the client requires several critical misconceptions about how software in general works lol.

Re: React is winning by default and slowing innovation

#748

Why do we need innovation? What are people doing nowadays with react and next.js version 100 that was too hard or impossible with JSF, jQuery, Angular 1?

You mean 15 years ago? jQuery gives you a list of helpers to manually mutate the DOM and style. Angular1/React allows you to declare a variable and to mutate the DOM and style automatically when that variable changes. Takes 10x less lines of code to achieve the same thing and it doesn't break if someone changes an id on a div. Angular1/React also gives you the framework to write reusable components.

It might not matter for a quick side project over the weekend, but it changes everything for a complex app with 10k+ LOC developed by several people and maintained over the years.

I switched from Angular1 to React 10 years ago because React is mostly standard JavaScript (I never need to open the React docs since I know how to write a function, a loop and a condition in JavaScript and I remember how to use React's core methods useState & useEffect) while Angular1 has hundreds of methods and DSL syntaxes to remember.

Re: React is winning by default and slowing innovation

#749
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 is how someone who knows only HTML and no programming languages would go about writing some Javascript. Which is a good thing IMO.

Re: React is winning by default and slowing innovation

#750
post #423

Earlier quoted context omitted.

Frankly it's incredible what any of these frameworks have been able to accomplish given the bonkers platform they have to work on. HTML, CSS, and JS made sense back when the web was primarily text with some simple forms. It's a dog shit foundation to build highly interactive apps on. The whole thing needs to be thrown out and rebuilt.

It is dogshit compared to what? GTK or QT, Java toolkits? There is no better cross platform way of implementing applications, especially if you want to do mobile in the same stack.

That is unfortunately true. Our industry settled on the worst possible solution to solve that problem.

Compare how it feels to use an Electron app like VSCode or Discord to a native app like Zed or Sublime. It's night and day, but the latter takes a lot more effort.

Post reply on HN