Re:Redux – Not Dead Yet
by lmm on Wednesday April 25, 2018 @06:49PM
(#16927081)
I wasn't talking about JSX one way or the other - just trying to explain what the issue with PHP was and how the industry moved away from it.
[ Parent
| on HN ]
Yes. But... JSX is not HTML. And no, the issues PHP had with embedding HTML do not apply to JSX.
JSX is a paper-thin DSL on top of Javascript. JSX components are regular Javascript functions and classes. You work with them the same way you work with any function it class in JS. Unlike PHP where it was actual HTML interspersed with PHP code.
I get that JSX is a DSL that ends up being javascript. But there are a lot of arguments why we don't write HTML directly between the PHP which still apply to JSX, even though it's not HTML. For me as a programmer it doesn't matter what happens under the hood.
Whether I type `return (<button>foo</button)` in react or echo '<button>foo</button>' in php, it's the same thing from my point of view as an application builder.
> there are a lot of arguments why we don't write HTML directly between the PHP which still apply to JSX, even though it's not HTML.
Such as? This is the point in dispute, so you need to actually make specific arguments if you think they apply.