4 ms·
> The reasons to choose it in 2000 were compelling, but there is no reason to choose it today — the world has changed, and there are dozens of better choices no
by wwweston 11y ago
> The reasons to choose it in 2000 were compelling, but there is no reason to choose it today — the world has changed, and there are dozens of better choices now.
I'm not convinced that he has the reasons for choosing PHP quite right -- either circa 2000 or now.
If you're writing your own web application, really, you've always had complete freedom in choosing the language. Saying your alternatives in 2000 were C, Java, Perl and ASP captures the zeitgeist rather than the actual choices. For example, Python was already a solid option (and Zope was a thing), and a few people/companies you might have heard of even built a successful startup or two off of weird choices like Lisp or TCL. That's one of the great things about the web: you speak HTTP/HTML, it doesn't matter what your back end is written in.
What PHP always had going for it over other options were these things:
1) It was really easy to add to Apache-based commodity shared hosting. So people running hosting companies did. So it was widely available on very affordable hosting.
2) The document-as-program model. Yes, it's terrible from a "separation of concerns" standpoint. Yes, you hate it for the right reasons. That's probably part of what keeps you seeing its strengths:
(a) It's an easy model to grasp, and a particularly gentle step for someone who's only written markup documents. It doesn't even have to end in spaghetti madness (though that's a popular path).
(b) The deployment story is dead easy.
3) Arguably one of the better online reference/tutorial sets for a long time (much less true today, but circa 2000? yeah).
As far as I can tell, it still has most of these advantages which made it the de facto runtime of the back-end web. And it's stayed more or less competitive as a more serious option as various developers and high-profile users have improved the language itself and shaped the practices of the community.
There are two things I see that may be potential sea changes, though:
1) The rise of JS on the back end presents another easy path for people who might start as document authors and then move into front-end scripting. Maybe. Node still has deployment issues and some other complexity I don't think PHP presents. I'm keeping an eye on nginx+js, though... that story sounds enough like Apache+PHP to me that I think there's potential.
2) Or maybe traditional shared commodity hosting doesn't matter as much anymore. The VPS is essentially price competitive with generic hosting now. On the other hand, that's just cost in currency, managing your own virtual server often means more of a sysadmin/ops time investment (not always a gentle step). But then there's containers, and I wonder if managed standardized package configurations for them might finally mean the deployment story for other stacks is going to get as easy as PHP (or even easier).