5 ms·
Not to take anything away from this post because PHP is a mess, but yesterday I dragged and dropped some PHP files onto a server with FileZilla, opened the righ
by skrebbel 8y ago
Not to take anything away from this post because PHP is a mess, but yesterday I dragged and dropped some PHP files onto a server with FileZilla, opened the right URL in a browser and it worked. No bundler, no docker, no kubernetes.
That was some PHP Happiness right there.
- kijin 8y agoI also like the single-threaded, shared-nothing architecture that PHP inherited straight from the CGI days. Every request is guaranteed to start in a clean state. It's amazing that PHP 7 is as fast as it is even while sticking to the execution model of a shell script. I wish I could run Python or JavaScript this way without losing too much performance.
- skrebbel 8y agoYeah me too! Essentially PHP is a purely functional programming language in the Rich Hickey sense ("If a tree falls in the woods, does it make a sound? If a pure function mutates some local data in order to produce an immutable return value, is that ok?"). PHP is like React on the server side, since the HTML output is a pure function of the request (and external state in eg a database of course). I like to think that it's no wonder that React got invented in a company totally built on PHP. Someone must've complained "I just want to change the URL and rerender the entire page with every user action, not mess around in jQuery". Someone else said "But that won't be fast enough!" and then someone must've gone "Hmm, but couldn't we make it fast enough?"
- solarkraft 8y agoOne might argue that React is clunky (but I completely get the benefits).
- skrebbel 8y agoWhereas PHP is a beacon of elegance? :-)
- dsego 8y agoActually, the story about PHP inspiring React is totally correct, at least I remember reading it somewhere when React just came out. Also Composer inspired Yarn, the NPM alternative.
- symlinkedtonull 8y agoRegardless of PHP's warts, Composer is definitely something worth emulating.
- GrumpyNl 8y agoThats how i work to and i love it.
- newaccoutnas 8y agoWell you could say that for anything that doesn't a) Require 'compose' (as you say, no bundler) - so no dependency management (not ideal) or your code is so minimal it doesn't need any, which isn't the case for large projects b) Require any infrastructure that's hosting the PHP app needing to be configured in the first place. That was conveniently overlooked. i.e. You don't even need to SFTP any files with something like Heroku or PaaS. It's an apples and oranges comparison imho
- open-source-ux 8y agoIt's almost 2019 and it's pretty amazing that no other language among the dozens available for web development feature easy server-side deployment. It's frustrating and baffling for anyone who wants to provide users with an easy way to self-install or self-host. Easy server deployment of apps simply doesn't exist (unless you're Wordpress with one-click installs available everywhere). Many developers consider easy deployment a non-issue. Here's a previous question I asked on the topic: https://news.ycombinator.com/item?id=14781420 https://news.ycombinator.com/item?id=14781420
- evilduck 8y agoThere are other languages that can behave like this, Ruby ERB templates are one that can be done the same way. You can't just drag and drop PHP without some initial server side configuration either. The reason it's nearly 2019 and no other language does this is because it's a really terrible way to manage software deployment.
- josteink 8y ago> The reason it's nearly 2019 and no other language does this is because it's a really terrible way to manage software deployment. I’m not a fan of PHP (the platform), but that sure sounds more like an opinion than an objective truth. Could you outline some objective reasons why simply copying the code you want to run to the server you want to run it on is a bad deployment model?
- code_duck 8y agoI agree, I don’t hesitate to use PHP for quick tasks like that. But would I try to write serious software in it? Definitely not.
- theamk 8y agoUnfortunately, the ease of deployment often means lower security. Lots of popular packages expect regular web user to be able to update source code (!), totally defeating any protection OS may provide: https://www.drupal.org/docs/7/install/step-4-run-the-installation-script https://www.drupal.org/docs/7/install/step-4-run-the-install... PHP is really nice and easy to deploy, and it would be my first choice for trivial one-file scripts, but I wish people did not use those simple deploy methods on the big internet. The net is not a nice place it used to be 10 years ago, and today, deploying scripts without any OS-based security protection is just irresponsible. (And yes, it is possible to deploy PHP in the secure way with proper privilege separation, but most of the large, existing projects recommend doing it insecurely)
- CM30 8y agoYeah, and that simplicity is also why systems like WordPress, Drupal, etc aren't going anywhere any time soon either. Yes they require an install process and a database setup, but compared to their newer competitors like Ghost, that's a lot more viable for someone with little computer experience than figuring out the command line or what not. Like it or not, PHP and many applications written in it are more user friendly than many of their alternatives, which is worth a lot more to average Joes than security or code quality.