Hacker News new | ask | show | jobs
by kabes 3379 days ago
Euhm. Jsx and vdom are exactly About abstracting away the browser environment...
1 comments

Erm, what?

JSX doesn't do any abstraction. Unless you're using React Native, you're writing HTML, just that JSX turns it into `React.createElement(...)` calls.

The VDOM is kind of an abstraction, as React Native can use the same reconciler as React, but the React (web) VDOM is just a tree of HTML DOM nodes that gets diffed against the component rerender output and the changes are applied to the DOM.

Ummm.. kabes is right. React is an even bigger abstraction on the browser than angular 1 is. Its just that with React the abstractions are mostly opaque - and with Angular the abstractions are not so opaque ( and maybe sometimes leaky! ).
I think you got that backwards. React's abstractions are transparent, as in the developer doesn't need to "see" them or be aware of them. Your existing web dev knowledge largely applies.
> I think you got that backwards. React's abstractions are transparent, as in the developer doesn't need to "see" them or be aware of them.

He doesn't have it backwards.

He means they're "opaque" abstractions, in the sense that they're the opposite of a "Leaky Abstraction"[0]. A leaky abstraction is one wherein the abstractions below it "leak" up and you have to keep multiple abstractions in your head at once. This happens more with Angular than React.

I see what you mean by calling it a transparent abstraction though, since React's abstractions get out of your way and let you directly think about the lower level. This doesn't really fit with the Leaky abstraction analogy though, but it's a great point.

[0] https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-a...