4 ms·
PHP was and still is great. Make a change and hit refresh. Simple and easy.
by tonetheman 4y ago
PHP was and still is great. Make a change and hit refresh. Simple and easy.
- cutler 4y agoThe Clojure repl allows you to eval changes within a live application. Try that in PHP and I don't think you'll get very far.
- cess11 4y agoWhat do you mean by "live application"? Is a PHP application under nginx "live" or not? If it is "live", changing a file will immediately be reflected in the application on the next "eval", i.e. require or execution by the interpreter.
- klibertp 4y agoNope. That's not what the GP means. I'm not sure how it works currently with PHP, but what was meant was a long-running process that can change its behavior/be updated by evaluating new code without ever being restarted. Think of it like this: you have a page that never stops rendering, ie. you send some HTML but instead of finishing processing, you go into an infinite loop. "Live" system, in that situation, would still be updatable - you could change the body of the loop and make it produce another bit of HTML, without reloading the page. Again, I'm sure modern PHP was already optimized far from the initial "execute all the code on each request" model, but unless there's a long-running process that can be updated in memory without restart (and I don't mean doing `exec` on itself, that's cheating!) - it's not "live" by this definition. It's not that clear-cut a distinction, either. For example Elixir and Phoenix are definitely live, in that there's a process that responds to requests on one hand, and can be updated without restarting it on the other - but page reload is still required in many cases, even if triggered via websocket. This idea of liveness predates both PHP and the Web by 2 decades at least and comes from Lisp and Smalltalk. It's been incorporated by Erlang and later Elixir, and by Clojure. Other than that, some embedded scripting languages support this kind of development, for example Awesome WM is scripted in Lua, and you can evaluate arbitrary Lua code while it's running. Emacs is another system that is meant to be used this way. Good to read: https://gbracha.blogspot.com/2020/01/the-build-is-always-broken.html https://gbracha.blogspot.com/2020/01/the-build-is-always-bro...
- mm007emko 4y agoI upvoted your comment but I only partially agree. PHP is great in some ways and totally atrocious in other ways. It put bread on my table in the 2000s but I am not looking back. The language is horribly designed. Writing AJAX calls before Google Chrome was even released (let alone its V8 Engine which made JavaScript fast) was no fun either. Any non-trivial web app we developed was slow (everything had to start from scratch with each request) and flooded with a couple of layers of caching which often didn't get invalidated properly. Now I am a purely backend&desktop developer, I leave web frontends to people who are willing to live in the JavaScript world where if no big framework is released every 5 minutes you have an impression that the Earth stopped spinning. I learnt the basics of React.js the other year and it's a far cry from what we had 20 years ago. ClojureScript+React even with its difficulties must be an ivory tower of modern web frontend development. I want to remember the good parts of PHP, frameworks Nette and Symfony with nostalgia. But I never want to re-live it again. I mean Request/Response websites with a bit of AJAX still work today, I even develop one as a side project since I am part-time involved in academia (neural networks & nature-inspired algorithms simulator, in Common Lisp with cl-who, Parenscript and a couple of custom components based on HTML5 Canvas). But modern development? When you need to keep up with the latest trends? No way it can work.