4 ms·
For reference, I'm working with both React and PHP. And yes, for example WordPress uses React components. I'm a 42 year old software architect. But hey, maybe
by koonsolo 4y ago
For reference, I'm working with both React and PHP. And yes, for example WordPress uses React components.
I'm a 42 year old software architect. But hey, maybe I've been ignorant all this time.
React vs PHP is a decision you can make, because... the intention of both is to output HTML.
edit:
> The easiest way to explain it is that you could reasonably use react within a PHP project.
I can use C within a Python project. Does that mean I can't compare the two? One is compiled while the other is interpreted, so maybe you can't compare those?
- shkkmo 4y ago> React vs PHP is a decision you can make, because... the intention of both is to output HTML. Often PHP is used when no HTML rendering happens at all (Apis, scheduled jobs etc.) > I can use C within a Python project. Does that mean I can't compare the two? One is compiled while the other is interpreted, so maybe you can't compare those? Those are at least both programming languages. Several major python libraries are written in C (or other compiled language) so a pure python project is probably fairly rare. Someone asking for "Python vs C" is probably more in need of an explanation of what the broad categories mean and tend to be used for than a point by point breakdown of specific language features and ergonomics. In this specific instance, the complaint was that PHP, a server side language, doesn't offer client side rendering built in. This a point that should be brought up comparing JavaScript to PHP, not React.
- koonsolo 4y ago> Often PHP is used when no HTML rendering happens at all (Apis, scheduled jobs etc.) When comparing to React those things are irrelevant. > the complaint was that PHP, a server side language, doesn't offer client side rendering built in. So am I allowed to compare server side rendering to client side rendering? Or are those 2 different things and I'm ignorant if I try to compare them?
- shkkmo 4y agoIf you complain your tesla doesn't float very well, then you might be a little ignorant of what cars are used for (and that you probably should have used a ferry.)
- koonsolo 4y agoReact can be used both on the server and client side. That is a benefit over something that can be only used on the server side. React can even be both on server and client using 1 codebase (see Next.js). But it seems the PHP police here on HN does not allow me to compare that solution to a solution in PHP.