Live data from Hacker News

Does anybody like React?

jsx.lol

231–240 of 353 posts

Re: Does anybody like React?

#231
post #81

Of course people do. No one is forced to use React or any other web framework unlike how they are practically forced to use JavaScript, and yet React wins. This should be enough evidence that people like it enough, at least more than most other frameworks out there. It is also somewhat ironic that until late 2010s a common complaint about web development is how fast it changes and how many new things are coming up al…

React does have its benefits, but there is also a tendency to pick it because of the inertia it has over whether it is the best tool for the job. "Everyone uses react and this will maximize our hiring pool / set of contractors we can use", "A react project will look good on my resume".

I don't see why "inertia" or adoption should be excluded when deciding what library to use for the job. If you are manufacturing a physical product you will need to consider how easy it is to source any component before adding it to your bill of materials. I don't see why software engineering should be different. There is a reason why we are all working in boring languages and not Haskell or LISP despite their supposed technical superiority.

Re: Does anybody like React?

#232
post #123

Earlier quoted context omitted.

React was a major improvement over Backbone + Marionette. Pre-jQuery was a shit-show as they hadn't even standardised the DOM. Before that was XMLHttpRequest (particularly during my .Net WebForm days) and even had to use the ActiveXObject in IE that predated JSON.

Give me Backbone + anything over React. Backbone was the last time I really felt close to the web page I was creating.

We're still using it for our stuff (via our @beanbag/spina TypeScript wrapper for Backbone that has a few additional niceties), and I feel the same way. We can be as close to the DOM as we need (or let something manage it for our view for us), we can be smart about where data lives and how things interact with it/listen for changes, and we get a decent little object model that doesn't dictate how we think about everything.

Very happy still with the Backbone way of building webapps.

Re: Does anybody like React?

#233

Earlier quoted context omitted.

It’s a distinction without a difference. Both need to be transpiled, what happens under the hood is of little concern to anyone. Please explain React’s reactive data binding since it’s apparently much simpler than v-model= ;)

It is a massive difference. I do not like magic compilers. The JSX transform is trivial and not even necessary, just create a factory function and React.createElement becomes arguably more readable, just not HTML like.

Is it a massive difference, or is it a small difference? At the end of the day 99% of React projects have a transpilation step and utilize some form of “magic compiler” somewhere along the line.

The simplicity of JSX is overvalued. It just means more code, and typically uglier code, to achieve the same behaviour as Vue. Which is basically the theme of React when you compare the two libraries.

Re: Does anybody like React?

#234
post #6

It is the standard, and is extremely flexible. It was probably the wrong framework for most use-cases, which are often just CRUD screens. But, we are in an AI world now, so probably Javascript in general and even Typescript is starting to become the wrong move. Programming languages and frameworks which offer a ton of guarantees is what you need, now. In my humble opinion.

"Probably the wrong framework for most use-cases" is not that much of a recommendation.

Re: Does anybody like React?

#235
I basically skipped React. I went from jquery to Vue3, and use even that sparingly. When React got really popular, I read the docs and played with it, but I prefer the Vue model where the component runs once and sets up its reactive tree. Why would you want to recreate the component's inner functions every time it renders? And manually declare dependencies, when every other framework is doing them automatically?

My favourite front-end architecture is MPA actually mostly server-rendered, with Vue only on the pages that need high interactivity, and vanilla JS on the others.

Re: Does anybody like React?

#236
I like React.

I also hate React for many reasons, but I mostly like it because I genuinely believe React is the only front-end system I've used that got the fundamentals correct - they've just gotten many other trivial-but-still-annoying things wrong.

The fundamentals:

- no magic: this is a trend that the JS community has picked up I think from Ruby or maybe just Rails, but having a framework pick things up automatically depending on how you've placed them (directory structure, DSL files without explicit exports, etc.) means you need to learn each framework's magic independently & upgrade paths are harder when magic changes. React is just javascript - components are stored in variables, your app container is a native dom primitive & you need to call the render explicitly. This makes your entry points clear & idiomatic, & ensures your framework stands the test of time.

- composable (& somewhat fungible) primitives: React components are JS objects, there's certainly some elements of the underlying lifecycle implementation that's abstracted away once they're passed to the rendered, but at definition time they're just objects - they can be passed around, inspected, manipulated & ultimately they're not abstracted away & hidden from the dev.

- modular DSL: I'm suspicious of DSLs in general but if you're going to create a DSL, JSX is a masterclass in how to do it. 100% independent of React - you can use JSX without React or React without JSX. This modularity has lead to JSX getting broad high-quality third-party tooling support that all other front-end frameworks lack.

- imperative DSL. This is a bonus but the design of JSX is ingenious. Declarative systems are the dominant trend: everyone wants to create a well-defined strictly static language to define their front-end, but that design goal doesn't match reality. JSX isn't declarative: it's an extension of javascript, tags are function calls, attributes are params. This makes it incredibly expressive - I could write my backend in JSX if I wanted to (could be a fun experiment).

The bad:

- class-based components. This is less of a React problem & more of an ECMA problem but shoehorning Java-style classical inheritance models into javascript was always a bad idea & React was the main proponent of this style when it was popular. Thankfully we've moved past this phase & modern React no longer does this.

- lifecycle methods: these were tied to class components so were always going to end up becoming deprecated when classes went away but they also had other annoying fundamental issues - too complex to go into in detail here but their operation was highly abstracted which made debugging really painful

- hooks: the modern replacement for much of the lifecycle method functionally isn't much better. Thankfully hooks are mainly used for state management, which has always been an "added extra" in the React world (see e.g. flux), so you can minimise your hook usage & avoid a lot of friction if you're clever & careful.

Re: Does anybody like React?

#237

As someone who lived through all major waves of JS for the last ~16 years, I do love react, in a sense: React is the worst JS framework except for all the others we've tried. I'd take React over the Angular 1 days any time. I'd take Angular 1's full-bodied MVC over the "build it yourself from scratch every time" approach of Backbone. I'd take Backbone's minimal MVC structure over the classic JQuery Soup architecture.…

Where would you put custom elements in your list?

Re: Does anybody like React?

#238

Open source tech is a marketplace of ideas. If you have a more perfect alternative then it will prevail. Granted none of these critics have a viable tried and true alternative. It’s easy to throw shade at any abstraction. None will ever be perfect! That said, I welcome any new paradigms and ideas. But discounting how far we’ve come with what’s possible on the frontend with hand waves just doesn’t cut it for me.

I am wondering how much the "perfect alternative then it will prevail" still holds given the amount of money spent on marketing by infrastructure companies, for example Vercel that have an interest in promoting Next.

That’s a fair take. What happened to google’s angular ? Facebook is also historically invested in php, why wasn’t php just good enough? Facebook also had flow, Microsoft typescript won.

Sure these companies have influence, but it’s not all or nothing.

I just don’t buy the whole mass hysteria and funding being responsible for reacts prevalence.

“Frontend purity” reeks of the tired, “lazy unskilled engineers should write software in C and assembly on 16kb memory like the old days”

Reacts success is not from being an air tight optimized and perfect abstraction, it succeeds because it has a scalable abstractions which have relatively good ROI when you learn it even with its warts.

Re: Does anybody like React?

#239

As someone who lived through all major waves of JS for the last ~16 years, I do love react, in a sense: React is the worst JS framework except for all the others we've tried. I'd take React over the Angular 1 days any time. I'd take Angular 1's full-bodied MVC over the "build it yourself from scratch every time" approach of Backbone. I'd take Backbone's minimal MVC structure over the classic JQuery Soup architecture.…

But why over vue? My biggest frustration has been how vue ends up moving in the direction of react. The original component architecture with the html template, JavaScript state and css styles in vue was so nice. Even the data fetching a url in the component was so intuitive.

I was deep in Vue 5-6 years ago, so much that I offered internal training for it and had sessions with more than 20 people attending.

IMHO, React wins because you can just treat templates as variables. You don't need "slots" or other special stuff. It's simply more composable.

Re: Does anybody like React?

#240
post #96

Earlier quoted context omitted.

But why over vue? My biggest frustration has been how vue ends up moving in the direction of react. The original component architecture with the html template, JavaScript state and css styles in vue was so nice. Even the data fetching a url in the component was so intuitive.

Vue doesn't solve problems better than React (and solves them worse if you have to learn all their proprietary files and DSLs instead of JSX), so there's not much of a reason to switch. The real discussion would be between React's vdom and something like Solid's signals.

Vue solve single source of truth much better than react though. The shape of derived data and source data (or even external data) are the same and interchangeable. So you can write an api that works with both without handling implementation quirks at all.

The words borrowed from someone else:

The react is more about view.

The vue is more about reactivity

Post reply on HN