Live data from Hacker News

React chaos in mid and large web apps: Any different experiences?

old.reddit.com

21–30 of 52 posts

Re: React chaos in mid and large web apps: Any different experiences?

#21

It's one thing to complain about React causing chaos, valid, but I would like to remind everyone about the absolute trainwreck we had before. Just slightly before polyfills and opinionated frameworks. Sure, spinning up a quick JavaScript-infused html file with a jQuery CDN link was probably the fastest way to get going, but structurally, on anything larger, this was a horrendous nightmare for most projects I came acr…

React doesn't define any standard ways or libraries. You can still create any sort of mess you want.

Re: React chaos in mid and large web apps: Any different experiences?

#22
We've definitely experienced chaos when building large React apps. I don't think it's necessarily React's fault (though I'm not particularly a fan), I think the complexity is inherent in managing stage in both a client app and a server app. We've since moved to building apps with Phoenix LiveView and been much more productive. I've also built some libraries to give you the same benefits (single source of state on the server) when serving the front end in Elixir isn't an option: https://github.com/launchscout/live_state.

Re: React chaos in mid and large web apps: Any different experiences?

#23

It's one thing to complain about React causing chaos, valid, but I would like to remind everyone about the absolute trainwreck we had before. Just slightly before polyfills and opinionated frameworks. Sure, spinning up a quick JavaScript-infused html file with a jQuery CDN link was probably the fastest way to get going, but structurally, on anything larger, this was a horrendous nightmare for most projects I came acr…

React doesn't define any standard ways or libraries. You can still create any sort of mess you want.

Well, React in and of itself doesn't, sure, I agree. However, if you look at React code, from the Getting started to ANY example out there, they do all have a "structure" that easily identifies it as React code and each file has an inherent structure that I can easily split up in my brain to understand what's going on. So the use of React ... comes with ... some form of often-repeated structure/patterns.

Re: React chaos in mid and large web apps: Any different experiences?

#24

It's one thing to complain about React causing chaos, valid, but I would like to remind everyone about the absolute trainwreck we had before. Just slightly before polyfills and opinionated frameworks. Sure, spinning up a quick JavaScript-infused html file with a jQuery CDN link was probably the fastest way to get going, but structurally, on anything larger, this was a horrendous nightmare for most projects I came acr…

React doesn't define any standard ways or libraries. You can still create any sort of mess you want.

It absolutely defines a standard for what a "UI Component" is and how its behavior should be orchestrated by the APIs React provides.

What it doesn't provide is a way to manage complex state that persists beyond the scope of one component (Context isn't good enough), and every single app has state that persists beyond the scope of one component

Re: React chaos in mid and large web apps: Any different experiences?

#25

It's one thing to complain about React causing chaos, valid, but I would like to remind everyone about the absolute trainwreck we had before. Just slightly before polyfills and opinionated frameworks. Sure, spinning up a quick JavaScript-infused html file with a jQuery CDN link was probably the fastest way to get going, but structurally, on anything larger, this was a horrendous nightmare for most projects I came acr…

I agree, we can't go back. And we should acknowledge how important and transformative React was for web development. It's easy to criticize in hindsight. Now our job is to come up with something better, taking what we now know that we didn't when React first came on the scene.

Re: React chaos in mid and large web apps: Any different experiences?

#28
With server components/actions you get rid of most useEffect()s and a lot of useState()s, and with the upcoming React compiler you get rid of useMemo(), useCallback(); Redux and other state management tools become pretty irrelevant for many server-component-driven apps as well.

But I agree that React attracts a lot of mediocre and inexperienced programmers, and does not provide very much guard rails against doing bad things, so predictably the average code quality is terrible.

Re: React chaos in mid and large web apps: Any different experiences?

#29
I'm an experienced web dev, who mostly works with Vue. Sometimes I have to work on React apps.

Skimming through the list of sins, pretty much all of them look like things I do on a regular basis. I do not understand React. I find it pretty much incomprehensible, incredibly complicated, and overly complicated for what it does.

I can't really described what `useEffect()` does, only that it's a solution I use when other things don't work. I can't tell you when I should use `useRef()` rather than state or props.

I never have any of these issues in Vue. Its conceptual model has always been pretty easy to grasp, although it got messier in Vue 3 since they tried to copy React more.

Re: React chaos in mid and large web apps: Any different experiences?

#30

If you're a react developer that started in the industry in the last 4 or 5 years, I'm sorry. The web industry did a real disservice to newcomers by pushing people so heavily into learning react from day 1, potentially without ever learning HTML, CSS, or browser APIs. Do yourself a favor and learn the platform if you jumped right into react. When react inevitably loses favor and the jobs dry up, you'll have a much ea…

I agree with this take. I learned web dev before React was a thing, mostly using jQuery at the time. Then as jQuery was falling out of favor I spent a lot of time learning the native browser API's and honing my fundamental JS skills as I focused more time on JS development.

I see a HUGE difference in fundamental understanding of sometimes even the most basic web dev fundamentals between people who learnt just starting with React from the get-go and people who did not. Its sad that people jump to using React from the start just to get a job at the cost of never learning these basic skills that used to be basically required knowledge for web development, and many never go on to get a deeper understanding.

Post reply on HN