Live data from Hacker News

Ask HN: I can no longer like React, do you?

news.ycombinator.com

1–10 of 33 posts

Ask HN: I can no longer like React, do you?

#1
If you resonate with what I said, there is no need for me to write anything here, and if you disagree then no amount of reasoning will be enough. Instead I'll just say where I am coming from and avoid going into technical reasons too much..

I started frontend as a hobby in 2010, I've been working as one for 8 years. Jquery was great but everytime you had to invent your own MVP. Came angular and it was extremely verbose. Then came react, it didn't have proper state thing nailed down like angular but it was simple, elegant, easy to reason and made code standardized and easy to read.

I could join a new team and be productive in 3 days as a FE dev. Unheard of prior to React.

However, gradually all that has been taken away.

In my view peak React was when it used class..

in constructor you defined state

in componentDidMount and simple life cycles methods you did things you needed to do.

Now functions are actually fake, it's almost impossible to figure out when the app will render or update when the states changes. Hooks, HOC, Redux, etc... Now you hope it will does what it need to be done..

Before it was rock solid.. state management is even more messy and code is so far from procedural paradigm.. that you just hope. You can figure it out, but that's the thing you shouldn't have to figure out simple things. You didn't need to before.

I recently made a chat app all in plain js, all in one file, and it works wonderfully. I surprised myself how easy to understand it is despite there being some lack of isolation... i've expanded the code at least 8 times so far and speed of delivery is remarkable.

Turns out it's easy if there is no magic going and all code is simple, procedural, contained, and aptly named functions.

Best of all IDE actually helps a ton in refactoring.

Re: Ask HN: I can no longer like React, do you?

#3
React is still the best IMO. It's crazy how much you cover with setState and useEffect alone, I barely use the other hooks. Combined with adjacent tooling and paradigms like JSX, React Native, Next.js, I find the others can't quite keep up with the React ecosystem.

I had to use new Angular on a project recently, it's come a long way and it's actually not too bad especially with GPT-4 explaining the reasoning behind Angular, etc. However, it's no React! It's still just too complex, and I can't be bothered to get into decorators, and other quirks that come along with the Angular world.

If you're liking vanilla JS right now, you might like Node - do some backend stuff. It's just regular JavaScript. I think it's always good to stay brushed up on vanilla JS, I do one-off FE stuff all the time in classic HTML/CSS/JS, but for websites my go-to is definitely still React (Next.js typically). I prefer the declarative style, think it works well for FE state, you end up needing some kind of state management usually.

Re: Ask HN: I can no longer like React, do you?

#5
I think VanillaJs is fine until you forget about your codebase or have to work with other people unfamiliar with your code. It may work, but you will have to be very well organised, as everyone working with you.

Over the years, I used quite a few frameworks and Vanilla JS, and today, I would start a new project with React. It's not perfect, but it's the best choice for most projects since a decade.

Re: Ask HN: I can no longer like React, do you?

#6
post #3

React is still the best IMO. It's crazy how much you cover with setState and useEffect alone, I barely use the other hooks. Combined with adjacent tooling and paradigms like JSX, React Native, Next.js, I find the others can't quite keep up with the React ecosystem. I had to use new Angular on a project recently, it's come a long way and it's actually not too bad especially with GPT-4 explaining the reasoning behind A…

I genuinely can't think of anything Angular does that I felt was strictly better than what React does.

The closest is probably that Angular is batteries-included, whereas React is just a view library. This argument I would be more sympathetic with if those batteries did not include observables for (almost) everything.

(I know about Signals. Not a fan of that either)

Re: Ask HN: I can no longer like React, do you?

#7
React is nice as a UI library, the thing is that people keep adding more stuff inside the components, making it look more like an application framework, which it's not good at. It takes discipline to design a good interface between your UI and your business logic (even if it's UI related) and keep it that way. If the local state of your component is becoming too complex, extract it to its own store and link it to the child components that are using it. If you do that, it's relatively easy to handle. I have tried Svelte and Vue and I like them, just because the way to write them don't let you add big processing logic on them. So you have cleaner code. Redux-Toolkit, Next.js,… it's just making things complex for no reason.

I'm using Alpine right now and it's still feel like React (in a conceptual manner), but that's because I've never liked to introduce processing in my own code base, preferring services and other stateful stuff to be outside of my React components.

  function SearchComponent() {
    const [query, setQuery] = useState('')
    const resultList = useItems(query)
    return (
      
        
        
      
    )
  }
I still think that if you don't have a lot of states to manage, and plenty of pages, going Vanilla is better. If there's only one single page, but plenty of interactive elements, I'd go with Svelte just because I like declarative more. But that's a matter of balancing whether I want to interact with a build system or not.

Re: Ask HN: I can no longer like React, do you?

#10
post #6
post #3

React is still the best IMO. It's crazy how much you cover with setState and useEffect alone, I barely use the other hooks. Combined with adjacent tooling and paradigms like JSX, React Native, Next.js, I find the others can't quite keep up with the React ecosystem. I had to use new Angular on a project recently, it's come a long way and it's actually not too bad especially with GPT-4 explaining the reasoning behind A…

I genuinely can't think of anything Angular does that I felt was strictly better than what React does. The closest is probably that Angular is batteries-included, whereas React is just a view library. This argument I would be more sympathetic with if those batteries did not include observables for (almost) everything. (I know about Signals. Not a fan of that either)

The strange is, how long will it be just a view library. I‘m a beginner and was frustrated that the official react documentation advises to use next.js or some other react framework instead of vanilla react (because react is just a view library and you need routing, state management and other stuff anyway)

First thing which came to my mind was „huh, angular was right“.

And yes, vite and vanilla react is still possible…

Post reply on HN