3 ms·
The key difference between Java and PHP is the lack of a compilation step. I can change a line of code, press cmd+r and I see the change - whereas in Java more
by mschuster91 6y ago
The key difference between Java and PHP is the lack of a compilation step. I can change a line of code, press cmd+r and I see the change - whereas in Java more often than not I have to wholly restart the application container as hot-reloading is a complicated mess and tough to set up.
Also, in Java it is easy to end up with resource leaks whereas PHP always starts from a clean slate for each request. Way less headache for operations.
- koheripbal 6y agoRight, but in a corporate production environment where everything is probably deployed compiled or compiled shortly after, does that matter? No one is altering prod code.
- mschuster91 6y agoIt certainly makes zero or almost no downtime deployments easier. Assume a Java application with a database that accesses said database during initialization - for a schema change you have to take great care in code that both the old and the new code can concurrently work on the same database to achieve low downtime. With a PHP application, it's easier - spin up the new Docker container, disconnect the loadbalancer, do the schema change, and connect the loadbalancer to the new Docker container.
- kanox 6y ago> Also, in Java it is easy to end up with resource leaks whereas PHP always starts from a clean slate for each request. Way less headache for operations. That assumes you're running a new separate PHP processes for each request and an application built this way is unlikely to scale terribly well.
- mschuster91 6y ago> That assumes you're running a new separate PHP processes for each request and an application built this way is unlikely to scale terribly well. No. PHP always wipes the complete execution stack even in a long lived execution model like FPM or Apache mod_php.