Remix.run Logo
sfn42 5 days ago

I think React is fine, the problem is that every single react app I've inherited is ass - people just do everything incorrectly and overcomplicate simple things. Components with like 5 different useEffects, huge global state causing all kinds of bugs, way too much frontend logic in general. The amount of JS code that exists just to mimic things you can do with HTML and CSS is staggering.

Everyone complains that react is so slow and horrible, it isn't. It's their code that's slow and horrible, react is snappy as hell when you use it properly.

sensanaty 5 days ago | parent | next [-]

> It's their code that's slow and horrible, react is snappy as hell when you use it properly.

That's the problem though, it's hilariously easy to shoot yourself in the foot with React. If almost every project makes the same common mistakes, it ceases being an issue with the people using it, it's a broader problem. With Vue or Svelte you'd have to try damned hard and go out of your way to mess up in similar ways, because the idiomatic way of writing Vue, especially with Options API, is so simple and straightforward. How many articles do we have out there begging people to please stop using `useEffect`, for example?

Plus, React's reactivity model is terrible and a source of a lot of performance pitfalls. Vue's and Svelte's Proxy/Signals-based approach is much more performant out the gate, and in the case of Vue the diff reconciliation algorithm is a lot better than React's, which itself will already prevent a bunch of useless re-renders compared to 'standard' React apps.

sfn42 5 days ago | parent [-]

I don't know Vue so I can't compare. All I know is when I write react apps they're simple, nice and snappy. And I'm not even a frontend dev nor a JS dev, I mainly work backend. It's not that hard. In fact it's significantly harder to write a horrible mess. I have to spend ages cleaning up before I can start doing real work, because I can't deal with the horrible messes people make.

This isn't just a react problem by the way, people write horrible messy backend code as well so I'm having a hard time believing that they wouldn't find a way to make a horrible mess of a Vue app as well.

But maybe you're right, maybe it is better. I wouldn't know.

sensanaty 5 days ago | parent [-]

I mean don't get me wrong, I'm not saying Vue is perfect, it has its share of annoyances that I hope get resolved, mostly around poor typescript experience with things like props and events for example. But for your average day-to-day Vue experience, it is in my opinion so much more productive than React, and importantly for the less skilled/knowledgeable members of the team it's so much harder to fuck up than React is. And as I said in my original comment, the codebase at work I maintain is a monstrosity, but because of Vue's patterns it's also easier to deal with and fix than the equivalent fucked up React version would be.

I'd recommend giving it, and especially Svelte, a try, especially with Options API in Vue (but CompAPI is nice too). It's really clear early on how simple it is, despite it paradoxically having more to it than React does (like the event/prop system)

zwnow 5 days ago | parent | prev [-]

> Everyone complains that react is so slow and horrible, it isn't. It's their code that's slow and horrible, react is snappy as hell when you use it properly.

Why use something that you have to use "properly" when there are things out there that enforce being used properly?

sfn42 5 days ago | parent [-]

Because I'm not convinced there exists a programming language/library/framework that you can't use improperly.

And just to be clear I'm not saying react is better than Vue. I don't know Vue. Maybe it is better. All I'm saying is react is alright in my experience, the problem is people overcomplicate and mess things up. I've seen that in pretty much every piece of software I've ever worked on, backend/frontend/whatever. So the claim that Vue just magically can't be messed up is difficult for me to believe.

zwnow 5 days ago | parent [-]

I can understand that. For me personally, Vue has a limited set of lifecycle hooks you can use so its hard to pick the wrong one. React on the other hand gives u some kind of use_ for everything, so its first and foremost harder to understand the app lifecycle and to pick the correct hook.

With Vue I started to use Pinia for my whole apps state management, which are data stores. Clean and centralized logic, with React idk what a substitute would be.

I know React can be clean too, but that (in my opinion) requires a lot more depth of knowledge about the framework.