Hacker News new | ask | show | jobs
by pjmlp 2532 days ago
JSX feels like PHP and ASP all over again.

Apparently they aren't that bad after all.

4 comments

I hesitate to tell people. They are doing it wrong but if you write JSX like how we all wrote PHP back in the day then you are doing it wrong.
So how do you modularize content in separate files?
How can you say that? PHP and ASP were dumb text template processors. JSX creates object graphs. They are almost nothing alike at all.
Mixed content on the same file, looks pretty much the same, regardless how it is implemented.
The problem with ASP/PHP (or at least, the one we are addressing here) always mixing presentational logic with business logic. Something you still shouldn't do, and React doesn't advocate doing so at all.
I totally disagree. VueJS and AngularJS feel like PHP/ASP but I never got that feeling from JSX.
I fail to see how proper component based frameworks, with clean separation of concerns, provide such experience.

JSX is the one mixing echo like statements with proper JavaScript.

That is pretty impossible since JSX is just JavaScript, including all of its scope separation. It might be that you're not well versed in using it.
JSX let's us define components, usable with the usual HTML syntax. PHP does not. That's why Facebook developed XHP (XML fragments in PHP), which inspired JSX.