Live data from Hacker News

React I love you, but you're bringing me down

marmelab.com

151–160 of 574 posts

Re: React I love you, but you're bringing me down

#151

Earlier quoted context omitted.

> They have their place. How so? There is nothing that a class-based component can do that a hook-based component can't (EDIT: Except for error boundaries). I'd go as far as to say class-based components are strictly inferior because they force you split your behavior logic across lifecycle methods and are not easily composable. I've been able to support much more complex behavior easily with hooks (e.g., connection…

You still need to use class components for error boundaries. https://reactjs.org/docs/error-boundaries.html

Yeah, this feels like a weird oversight.

Re: React I love you, but you're bringing me down

#153

Earlier quoted context omitted.

I would argue it's 100% greenfield effect. A rewrite fixes all the things but introduces new problems. I would bet the OP could've achieved the same effect by figuring out what's wrong with their codebase (which honestly is easier for an outsider to do than someone who has worked on it everyday). And I would caution against converting anything to a non JSX or hyperscript language (like svelte or vue), you don't want…

To clarify, this was new development — not the process of rebuilding of an existing app. For that reason, the greenfield development was indeed simpler. That being said, it’s been one year and making changes to the Svelte application is (in the developers’ opinions) easier than our set of comparably-sized React applications. Of course, all of this is specific to our team members’ skillsets, the application complexity…

That's interesting. 12 months is still very early though, unless it's a project with a lot of throughput.

Re: React I love you, but you're bringing me down

#154
post #99

Earlier quoted context omitted.

I totally agree. I actually stopped using React around the time hooks were announced. In retrospect it's still not clear if hooks were even a good idea. Changing the core methodology of a project used by millions of developers at the time was extremely irresponsible. They basically made obsolete all React educational resources overnight. I'm sure people making money by producing React educational content were very ha…

I keep seeing this sentiment here but as someone who’s used both the old paradigms and hooks - hooks are much better and simpler overall.

Your argument is very compelling. /s

Re: React I love you, but you're bringing me down

#155
post #45

Does anyone do server side rendering these days? I fail to see the point in SPA apps for the majority of web apps. At my work we have an ancient Dojo frontend and a newer react one being build. Its a few list views that the user can filter and a few forms with validation. It's a ridiculous amount of complexity to avoid loading a page. I could do almost everything for half the effort with server side HTML from Django…

I feel the same!

I work on regular ol' websites, that have some pages containing some moderate interactivity – so a few years ago the project adopted React to handle the frontend. I've found the experience mostly OK, but I sometimes get the urge to simplify things by leaning more on server-rendering / maybe using the URL to capture state...

and then realize I can't, and that this is Just The Way It Is Now. Because now all our devs expect to use React (or more accurately, its vast ecosystem of 3rd party functions of varying quality) to accomplish anything, and we forgot to screen for hires who can write their own JS+HTML or who understand how the response/request process works in a web application. (oops!)

"React hires are easy to hire for" so that often drives decisions, but I am skeptical my project ever needed React (or any hyper-optimized-for-SPAs-feature).

Re: React I love you, but you're bringing me down

#156
I keep saying we need a state-ful GUI markup language standard so we don't have to re-re-re-reinvent real GUI's with JS+CSS+DOM. Those weren't meant for real GUI's and retrofitting creates bloated, buggy, ever-changing messes. GUI's have been around more than 30 years, why can't we network-ify its common and loved idioms?

Re: React I love you, but you're bringing me down

#157

Earlier quoted context omitted.

I ditched React soon after they released hooks, mainly because I couldn't relate to the tradeoff React roadmap was taking from there. They went in a different direction from that point onwards, it seem like whatever code you write will become obsolete with the new set of best practices in the next release cycle. More importantly, I realized React is trying to tame Facebook level of problems and hence their design dec…

I don't have a strong opinion either way but if you left React because you are frustrated with code becoming obsolete and picked up Hotwire, a significantly smaller framework, arnt you likely to run into the same problem if Hotwire doesnt end up being the next big framework? In 5 years if no one else is using Hotwire then your code is obsolete, no? I liked working in next.js in the past but my company was already tal…

In 5 years if no one else is using Hotwire

I think that's the opposite of what he is saying. Because React is updated and changes frequently, your code becomes obsolete unless you update to follow the latest changes. In theory, if everyone abandoned Hotwire, your code would never be obsolete or need changes, because Hotwire would never change. In reality, as browsers and web standards change, frameworks need updating.

Re: React I love you, but you're bringing me down

#158

As a developer who’s been working with React since the beta, I can confidently say that the author is speaking the truth. Especially so near the end of the article where they can’t seem to quit React. For all the annoyances of Hooks, they really are a godsend when it comes to composing state. And refs do indeed suck, but they sucked even more with class based components. I can’t tell you how many times I was able to…

React is low level. Svelte and Solid are low level too.

You are dealing with particular values and wiring everything meticulously.

Whenever I write stuff using https://rxjs.dev, writing React feels the same.

Using ExtJS years ago felt higher level than React.

Re: React I love you, but you're bringing me down

#159

Hmm… let me be frank about my experiences with React. I’ve been using React heavily for far over 6 or 7 years. React is amazing. And what I see is that people find so many ways to shoot themselves in the foot. At the same time, I understand that batteries-not-included approach will lead to that result. First of all, people get out of their skin and try to make it a complicated and entangled mess. In programming, ther…

Where are good examples of clean, well-implemented React code by your definition? Because your comment perfectly encapsulates my experiences and frustrations in learning and using React off-and-on over the past 8 years or so.

React is the one tech that really freaks me out because every time I have to dive into it, it's a completely different beast and it feels like so many people actually writing in React are just effing CRAZY

Years ago I wrote a 12-line-or-so JS "framework" that did one-way databinding, it accepted a fragment of HTML with template strings and replaced those with the data you wanted... it could handle thousands of updates without falling over (though updating the whole table would freeze the browser for a half second) and last I checked was still in production doing fine. But now nobody understands it and I'm fielding weird questions about why X framework wasn't being used in 2015 when I wrote it. And it feels like 90% of what I do in React is the same thing! (Simplifying, sure, but my point is that React feels bloated as hell and reinvents the wheel way too much)

Re: React I love you, but you're bringing me down

#160

Earlier quoted context omitted.

Hooks are not a "language", they're just react API calls.

"Just" is not really fair here, they're a window into global variables. Global state is awful to deal with but a necessity in the real world, so having some sort of constrained global state is something we're always trying to solve in new ways, singletons, monads, etc. Here we have hooks, which is an interesting experiment but something I personally would have played with in some new framework rather than dropping in…

Depends on what you mean by global state. You don't have access to a single pool of global variables. You only have access to what you put there and what you've been given.
Post reply on HN