8 ms·
Look at the abject failure of Discourse. If it had been written in PHP then it would have completely replaced all current forum software. But the devs there hat
by JamesDeepDown 5y ago
Look at the abject failure of Discourse. If it had been written in PHP then it would have completely replaced all current forum software. But the devs there hate PHP and went for a modern stack which is all but impossible to install except for tech professionals.
In other words, they chose a tech stack which suited them as developers, and not which suited the end users of the software.
End users love PHP because you copy the files into a folder. That's why it's so popular. That fact that you are talking about architectural "elegance" shows how removed you are from understanding the needs of the end user.
- joelbluminator 5y agoYou mean simply running Discourse (a Rails app) is so complicated no one wants to do it? And if it was simply PHP boom business would have been booming ? I find that a bit hard to believe.
- open-source-ux 5y agoDevelopers underestimate how difficult it can be to deploy server-side code for web apps or dynamic websites, particularly for less-technically minded users. As other posters have mentioned, PHP code can be as simple as uploading files to a folder on a server using a GUI FTP app. (And for some non-technical users, even that might be too complicated). By the way, Jeff Attwood (co-founder of Stack Overflow and one of the founders of Discourse), had this to say about PHP: "If you want to produce free-as-in-whatever code that runs on virtually every server in the world with zero friction or configuration hassles, PHP is damn near your only option." [1] When did he say this? 2012. It's now 2021 and has anything changed? Not really. Yes, we have Docker, Cloudtron, or Sandstorm etc but none of these are simple or easy to install or use. (A developer's definition of 'simple' and 'easy' bears no relation to the real definitions of these words). Whatever you think of PHP, consider the following question: what language can match or beat PHP for ease of server-side deployment? [1] https://blog.codinghorror.com/the-php-singularity/ https://blog.codinghorror.com/the-php-singularity/
- joelbluminator 5y agoBut almost no one writes php alone. Maybe hobbyists or Wordpress users. When we talk about actual applications that talk to a db - people use frameworks. Is deploying a Laravel app so much cheaper or different than a Rails app? Yes if all you need a wordpress website PHP is obviously the way to go. If you're an app developer PHP loses this edge quite quickly. Also I'm not sure an ftp setup is easier than Heroku.
- gremlinsinc 5y agoYou "CAN" upload laravel to bluehost or any shared host and it will work, you may need to cut a few bits, or use external services for redis/sqs/etc if you want to use those things, or you could just use file/database for sessions/caching/etc. I mean I started laravel on shared hosting, why did I use laravel for most of my career? Because the job I was hired for was to build a custom CRM for a book business, I was learning Rails so I spent 2 weeks on a rails prototype... Boss gave me access to their hostgator account - shared hosting and told me to install it there. I stared blankly at them, um... okay. Rails version I built in didn't match and I couldn't figure out for the life of me how to make it work... Laravel 4.2 was almost a complete 1:1 match (in terms of directory structure) to rails and the language was just a bit different so porting what I had to laravel was a cinch and I had it done in 3 days and up on hostgator. No problems. Also if you're like me and you freelance/consult, there's a TON more business in existing software/legacy than there is in new builds. Wordpress, Shopify, Laravel, Drupal, Magento, Salesforce are probably the FAANG of freelance platforms to learn to earn income from. PHP is also generally faster than Ruby, and with Swoole it's sooo much faster (even than elixir/phoenix), so really why not use laravel/php. There's also tons of great packages out there and tutorials. The community is freaking HUGE. Rails you even have to roll your own auth system or use devise which is a PITA. Laravel it's more opinionated but it's built for you including 2fa, social/oauth, etc.. Which isn't to say I wouldn't use fancier langs, I'm jumping at the bit to build some backend apis in rust or go for the hell of it, but only when I'm the decision maker as CEO/CTO on a side-project. For bread and butter I'll stick w/ what I know I can get paid for which is PHP/Laravel/Wordpress/Vue/Livewire/etc.
- lukaszkups 5y agoAs a front-end developer I can agree with that. Many times when I've wanted to install something for my needs, like forum engine or something similar, I was looking only for an PHP option. Why? Because it really is a copy-paste process with typing credentials to your database into dedicated file. No need to know any language/framework-specific commands, and no need to be overwhelmed by missing dependencies. And in huge addition to that, simple PHP hosting is extremely cheap - for years I've been paying for my personal server ~$20 PER YEAR, where servers that enables you to use Node/Ruby etc. costs around at least $10 per month. This is a huge game changer for me.
- joelbluminator 5y agoDiscourse is a pretty complicated piece of software (relatively). They do: mailing list, discussion forum, long-form chat room, This isn't gonna be some static blog, it's feature heavy. It needs redis, it needs some real-time chat capabilities etc etc. Also the choice to use a framework (Rails in this instance) was sound since it's complicated. So when comparing deployments you need to compare it to the php equivalent (Laravel). I think deployment and memory footprint are gonna be quite similar then.
- disgruntledphd2 5y agoSo is facebook, and they wrote a lot of PHP for their first decade.
- deleted 5y ago[deleted]
- vaylian 5y agoHave you tried installing Discourse? It's not that straightforward. And then there's also the issue that you need a working e-mail setup, even if you only want to set up a local test environment.
- joelbluminator 5y agoAnd how would php solve the e-mail setup issue? I'm not saying it's straightfoward and I don't know Discourse at all. If they have dependencies like redis etc then yes it's gonna be more complicated. Just don't think a framework like Laravel would have been easier.
- rambojazz 5y agoObviously if the project requires working emails, PHP cannot solve it. If I understand the parent comment correctly, what it says is that sending mails with PHP is usually less problematic than other languages (IIRC from the last time that I used PHP -several years ago- their mail() function works OOTB almost everywhere, even on shared hosting, and is usually used by default or as a fallback).
- chipotle_coyote 5y agoDeploying a Rails apps is, in general, harder than deploying a PHP app. I'm not convinced that Discourse is the right example here, though. Arguably the actual steps for installing Discourse aren't significantly more complicated than WordPress's install, because they've gone out of their way to make it as easy as possible. (It does suffer from "you must use Docker for this," which would likely intimidate non-techies who could otherwise suffer through a WP install, though.) Also, I don't think Discourse can remotely be described as an abject failure, given that virtually every forum I've seen go up in the last five or six years runs on it, and I can think of more than a few sites that migrated to it from legacy PHP forums in that time.
- joelbluminator 5y agoWhat's harder about deploying a Rails app? Generally interested. How does it go in Laravel land then? Rails have quite a few dependencis (Node, webpack), how is Laravel handling front end?
- chipotle_coyote 5y agoI'll preface this by saying I'm probably getting a little ahead of my skis. :) But, I think the issue is less how modern PHP is handling all those modern dependencies and more how "old" PHP didn't make you, the person installing the application, have to know anything about them. Those old-style apps, which include WordPress and many forum software packages, get "deployed" by 1. Downloading the application archive and uncompressing it 2. Creating a MySQL database according to the documentation 3. Either editing a small config file to give the application the database credentials, or even just going to the application's index page and filling in the details on a first run experience And... that's it. Rails has no comparable experience, unless -- like Discourse -- you put in a lot of work to get it there. Laravel -- and Symfony -- work basically like other "modern" frameworks do, for both good and bad. Laravel has "Mix," built on webpack, for instance. So if you're looking for that in PHP, it's there, but that's kind of a tradeoff in the context of small sites deployed/managed by a single person -- a use case that I think modern webdevs sometimes lose sight of. If we go back to the example of forums, those are very often that "one person wants to host a forum for their community" kinds of things. (And I'd like to see more of us get back to self-hosted blogs -- which is part of what led me down the road of "can you write something in a not-PHP language that's still easy for someone who doesn't know anything about web development to deploy and run." The answer still seems to be "reply hazy; ask again later.")
- deleted 5y ago[deleted]
- onion2k 5y agoEnd users love PHP because you copy the files into a folder. That's certainly how people deployed web apps built by other people a decade ago, but these days isn't it more common to use something like Docker? Deploying a containerized app should be pretty much the same no matter what language it's written in. And Discourse does have a Docker container (https://github.com/discourse/discourse_docker https://github.com/discourse/discourse_docker), so I'm not sure the underlying language explains why it isn't popular.
- iagovar 5y agoNon technical people won't use Docker, it's too complicated. Unless you make some environment as easy and widespread as your typical CPANEL shared hosting, you won't compete with PHP for that kind of end-user.
- agustif 5y agoBut isn't all cloud offerings basically a better cpanel with docker or kube or whatever? Don't get me wrong, as a developer I hate the bloat, but as a UX/UI PoV you can install a lot of shit that's dockerized pretty easily... sandstorm.io is a cool way to self-host open source projects for example
- iagovar 5y agoCan I download your non-PHP app, copy and paste into a folder, and get it running after 5 clicks? More important, are the majority of apps of non PHP langs like this? Most PHP apps out there are dump easy to use. That's not the case even for Python.
- thejohnconway 5y agoThe absolute minimum amount of knowledge needed for this sort of thing is how to get files onto a server. Lots of people capable of that have absolutely no idea what Docker is or how it works. Lots of people know what it is, and what it does, but have not ever actually used it (like me!). If I was going to install some server software, and saw Docker, it would put me off — great, I have to learn Docker now? Docker probably is a better way of doing things, but it’s another layer.
- petecooper 5y ago>End users love PHP because you copy the files into a folder. That's why it's so popular. As a person involved with a PHP + MySQL open source CMS, this is the pull quote for me. The vast majority of web hosting I've experienced in the last 20 years offers PHP + MySQL out of the box, even on the crummy, ancient end of the spectrum. Related to this, knowing that just about any flavour of hosting can run the CMS in real terms is enough to keep the development in check so a wider audience can use it. There's not much point in us adding extra features if the minimum ride height is beyond the reach of most users.
- ahofmann 5y agoExactly. I run a lot of services on a lot of servers for 10+ years now. Only the non-PHP projects (postal, zammad, otrs, elasticsearch, graylog from the top of my head) are hard to maintain and/or to install. And most of them need much, much more hardware to run, than any PHP software I installed. For example my zabbix installation with billions of records needs much less CPU and RAM than my zammad installation with a few thousand tickets. PHP is an ugly language and I refuse to work without a fine-tuned phpstorm installation. But on the server side PHP is just working fine under all conditions.
- rambojazz 5y agoThe "copy into a folder" is true because PHP is usually configured within HTTPd, but it's also true for any other script that is configured to be loaded on demand (CGI, Python). But you still need to manage a server unless the server is manager for you. However, shared hosting used to offer HTTPd+PHP only. With other languages usually you have to manage the server cycle by yourself, that's why it's not easy as copy-paste.
- nickserv 5y agoI would avoid PHP and Ruby just the same, but for very different reasons. Anyway regarding deploying, these days Go is available. It's probably the easiest one to deploy, just copy the binary to the server.