DEV Community

Discussion on: 7 Reasons Why React is King of JavaScript UI Frameworks

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

The only reason to use React is probably the large community. I use it at work, but I really don't like it. It's not the fastest thing in the world, it uses JSX (which is an abomination), it encourages unstructured messy code...

I've also used VueJS and RiotJS (less well known, but has been around about as long as React - and seems to have been a large influence on Svelte) - and they are both much nicer to work with than React.

Collapse
 
raibtoffoletto profile image
RaΓ­ B. Toffoletto

I'm interested to hear why JSX is an abomination, because I cannot see why.

btw, people who do spaghetti code will do spaghetti code in any language / framework. Even the more strict ones, they just love 🍝.

As anything in JS, with great freedom comes great responsibility. πŸ˜‰

Collapse
 
brianmcbride profile image
Brian McBride

JSX isn't bad, but I see @jonrandy 's point.

I think since the first days of app development anywhere, there has been the constant learnings of "don't put your business logic in your views."

I don't use Angular as my first pick of a tool, but partly the reason many devs don't like it is because it forces them to actually use a MVC (varient) pattern. Since hooks came around, I see more and more code just thrown into hooks and shoved into view components.

This makes the code harder to test in unit tests and automation. It makes it hader to refactor or update later. It makes it harder to debug. But it sure is easier to code on the first pass.

Like all coding languages though, JSX can be great. React expects the developer to properly architect the app. If you take the time to build your logic in isolated modules (that can still be called in a hook) you end up with the "contollers" and "services" in Angular. Unless you are building a portfolio website or something crazy simple - a proper React app/site is going to be just as big and heavy as an Angular site.

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

For me, JSX harks back to the bad old days of PHP and ASP where logic and layout were horribly intertwined. JSX actively encourages this way of working once again - it's just awful. And yes, I know the mess is purely down to the way people are using it... but I've seen many other frameworks that keep this separation to a much greater degree - promoting much neater, coherent code.