2 ms·
> PHP has a massive upside over Python: You don't need to restart your application when you change the code. I see this as a downside: hot-reloading is somethi
by hk__2 5y ago
> PHP has a massive upside over Python: You don't need to restart your application when you change the code.
I see this as a downside: hot-reloading is something that should be part of your developer toolbox, not a feature of the language runtime itself. Otherwise, deployments are harder because by the time you’ve completely uploaded all your updated PHP files, the server already started to execute the code in the ones uploaded so far. Also, I hope you have a caching mechanism otherwise this "read the code from disk every time you want to execute it" must be a performance nightmare.
- moojd 5y agoNone of this is a problem in modern PHP. In production you flip a flag to turn on operation caching. You can also tell it to preload all of your code. You can then deploy the app and then clear the cache once all the files are there.
- tomc1985 5y agoIs there an implementation out there of hot reload that doesn't simply automate hitting the refresh key in the browser? Because if not then this vaunted 'hot-reload' feature is a joke. Some of the JS kiddos from my previous org were pushing this crap on me from some random React module that I can't remember and it was terrible. We had to run a second server that proxied our personal dev webserver just so the thing could send window.reload()
- hk__2 5y ago> Is there an implementation out there of hot reload that doesn't simply automate hitting the refresh key in the browser? Yes, there are some setups where the code reloads but the state stays there. I’ve worked like this with Clojure/ClojureScript in the past; for example if you’re working on a pop-in that appears after a click on a button, with window.reload()-based hot reloads you have to click on the button each time you reload the code, whereas with a state-preserving hot reload you don’t. It’s very useful on SPAs.