News for hackers. Stuff that matters.
Re:An Internet of PHP by iLoveOncall on Saturday September 09, 2023 @03:32AM (#37443085)
> The ability to interleave code and HTML was also tacky and never taken seriously

And yet people would take a bullet for React and the JSX templates.

Re:An Internet of PHP by _rm on Saturday September 09, 2023 @03:37AM (#37443114)
Funny how "server side rendering" became a hot new thing too.

I was so confused when I heard that, "like... a HTML file?".

Keep going at this rate and we'll be using frames again.

Re:An Internet of PHP by jiggawatts on Saturday September 09, 2023 @04:44AM (#37443399)
> using frames again.

That’s pretty much what htmx is…

Re:An Internet of PHP by sublinear on Saturday September 09, 2023 @07:13AM (#37444070)
> "like... a HTML file?"

Serving a static HTML file is not server-side rendering.

It's much dumber than that. The people advocating for SSR want the server to respond with HTML generated based on whatever is in the request.

Re:An Internet of PHP by fjfuvucucuc on Saturday September 09, 2023 @07:30AM (#37444176)
So like PHP?

This thread is so cope.

Re:An Internet of PHP by trilbyglens on Saturday September 09, 2023 @04:17AM (#37443282)
I too find this hilarious. Not because I want to defend PHP, but moreso that I personally sort of despise react and it's whole ecosystem. I've never liked writing code less than when dealing with a spaghetti monster react app.
Re:An Internet of PHP by omnimus on Saturday September 09, 2023 @08:29AM (#37444551)
Well React was born in Facebook which was famously PHP codebase. It makes sense.
Re:An Internet of PHP by parminya on Saturday September 09, 2023 @07:15AM (#37444080)
JSX and PHP are actually seriously different. When you break out of PHP, you're just outputting text to standard output. When you're using JSX syntax, you're constructing Javascript objects that can be manipulated using standard javascript techniques. Anyone who believes they're comparable seriously doesn't understand the task that is before them.
Re:An Internet of PHP by fjfuvucucuc on Saturday September 09, 2023 @07:28AM (#37444163)
Oh please, I professionally use both daily, JSX is just PHP with more steps.
Re:An Internet of PHP by thewix on Saturday September 09, 2023 @03:34PM (#37449432)
Though not JSX, with TSX you get type checking with your markup.
Re:An Internet of PHP by wildrhythms on Saturday September 09, 2023 @09:46AM (#37445343)
My reading of this thread is that people are comparing JSX as a templating language to PHP as a templating language, splicing PHP <? ... ?> into HTML like how we have { ... } in JSX. At the end of the day React lets you write a function that returns HTML just like a PHP file.