Whenever I see these posts of having to go on the defensive and reference market share, it smells like desperation. It’s the kind of thing you see from any thing that has a “legacy” perception, far less greenfield than it used to have, and entrenched users willing to switch away even if it doesn’t make sense to (trendchasing, how much it costs to rewrite, etc.). You get a lot of insecurity from the userbase as a result.
I say this as a PHP developer… on a minicomputer platform. You see a ton of articles like this in the minicomputer/mainframe space. Again, the technology, be it PHP or z, or whatever else, is good and gets an unfair rap (I’ll defend PHP’s ecosystem quality against current contemporaries, and a lot of those “legacy” platforms still have TCO advantages, etc.), but people get antsy with having their specialty being percieved as on the decline.
I don’t see it as “desperation”, and I’m not sure whether PHP is actually “on the decline”.
I think PHP is no longer trendy among certain niches, but that doesn’t really provide useful information. The trendy bubble – of “Big Tech” companies, startups, and the forums where their employees and sycophants post – is, well, a bubble. The number of people who are out there silently working 9-5 jobs churning out line-of-business apps in “dead” or “dying” languages is, every time I get a glimpse of it, simply staggeringly huge in comparison.
Oh, I fully agree with you. I support those 9-5 LoB programmers churning out not just PHP, but languages far older than that, and there’s a ton of them. Hell, PHP is still taught in schools. It’s just that pieces like these makes me feel you’re not confident in the technology’s future; it feels like you’re acknowledging it by compensating for it. I wonder if they read the same for i.e. CIOs outside the tech industry.
i think it is good to have these kind of links handy during random discussions to share, otherwise you/i need to make these points again and again if someone says php is dead and you should not use it and you don’t want to or can’t ignore.
Node.js has its place and its strengths (real-time message streams). But, Node.js also has its weaknesses (blocking the main thread).
Doesn’t PHP also “block the main thread”? As far as I understand the most common way to run PHP is to either let Apache or php-fpm spawn a bunch of processes that run their own PHP interpreter? Similarly, a production Node.js setup will have multiple Node.js processes running (managed by Nodemon or whatever the kids are running these days), so I don’t see how this is substantially different from your typical PHP setup.
If you’re talking about actual threads, yes. But “block the main thread” isn’t a problem in PHP, it’s supposed to do that.
Examples:
PHP uses one process per request (using short-lived forks of the main process).
Ruby frameworks typically use multiple processes with one thread per request.
Erlang treats every function call as a process.
All of these isolate each concurrent operation and prevents one operation from blocking another one. Think of this as preemptive multitasking.
Node.js does not do this. It serially processes events in a single process. For this to act as concurrency, each event needs to return quickly or the whole world stops. Basically cooperative multitasking.
None of the others have this specific problem to worry about. Sure, there are limits to the amount of concurrency a process/thread per request system can handle, but none of those concurrent operations interfere with another concurrent operation.
If you’re talking about actual threads, yes. But “block the main thread” isn’t a problem in PHP, it’s supposed to do that.
That’s… not a great counterpoint, IMO. That’s not the language doing anything special; it’s just the way we tend to configure our servers. As a language it’s objectively worse than Node.js for blocking the main thread. Also, it’s very common to deploy Node.js systems where we spawn N Node.js processes where N is usually the number of CPUs. Does that mean that Node.js doesn’t have a blocks-the-main-thread problem anymore?
I wouldn’t call it a great counterpoint, but it’s just used differently and I agree more with KayodeLycaon, because iirc it’s actually better than it sounds. The “short-lived forks” are not doing as much, if you look how a SAPI request in PHP looks it’s just kinda dumb and thus it finishes pretty quick, also there is/was also the mpm_prefork, where it’s already in the name.
I agree with what chreke said about the quoted sentence, I wouldn’t have written that like that either.
Also there’s a reason when nodejs came out it was such a hit for stuff like longpolling, it had as a strength in where PHP had a weakness, but some of these things have changed.
I would think most production Node.js setups run multiple Node processes in parallel and load balance between them using either a reverse proxy or something like cluster (at least I hope so!); “blocking the main thread” is not an issue in this case any more than it is in your typical PHP setup.
PHP is big. The trolls can proclaim its all-but-certain “death” until the cows come home, but no amount of heckling changes that the Internet runs on PHP.
PHP fans often get this wrong. We PHP critics do not proclaim the death of PHP; we declare that PHP is not a good choice, and defend that critique with principles of language design and implementation (PLDI). The fact that PHP is big and popular is not contested; but we see it as a tragedy.
I think the difference is that no matter if you like PHP or not, it’s a fact that it’s big, that many people use it (for whatever reason) and that it’s here to stay for a while.
That’s not inherently great or a tragedy, that’s just your opinion - unless you read “proclaim death” as a “I wish it died”, which is, imho, missing the point.
Also many people who are raging about PHP (not you) are still stuck in the PHP 4 era, which officially ended in 2008. It got a lot better, but if you think it didn’t get better enough, that’s fair.
I think the difference is that no matter if you like PHP or not, it’s a fact that it’s big, that many people use it (for whatever reason) and that it’s here to stay for a while.
But, so what? And that’s only half-rhetorical. Why would someone take the time to write a post about PHP being used a lot? I think the obvious answer is that someone who cites that fact is trying to argue that popularity is correlated with being “good” or at least “good enough”. But, citing the mere fact that it exists and is old is not a compelling case for choosing it. And, as @Corbin said, nobody is arguing that PHP isn’t used by a lot of websites (let’s be honest, though: how many of those are just WordPress where the actual “author” has no idea what PHP even is?). So, what exactly is anyone accomplishing by reminding us of the fact that PHP is still pretty prolific on the web?
At least someone who complains about PHP is actually saying something about PHP directly.
I’m glad you wrote this. I started a much more rambling comment with basically the same gist, but I let it sit before I submitted it, and I’m glad I did. It was a little… fiery because I was really rubbed the wrong way by the quoted sentence. PHP is an awful programming language and I do want it to die. But, it’s not “trolling” when you can back up the criticisms with (many) objective facts. And, before someone chimes in with the tired “You obviously haven’t used PHP since version 7” comment, I still use PHP regularly at $DAY_JOB, maintaining several different projects that are 7+. It’s still terrible and poorly designed.
Something that amused me about the article is the part about Vimeo using PHP. They see that as a success of PHP, but then mention that Vimeo is the creator of Psalm. So… PHP is so awesome that one of the success stories had to create their own static type system and checker from scratch for it! And, if you ever saw Psalm before PHP 8, you’d notice that PHP 8 basically upstreamed some of the type stuff from Psalm and/or PHPStan.
Similarly, Facebook doesn’t really count as a PHP success story, either. They spent ungodly person-hours working on compilers to compile PHP to native code, op cache stuff, etc, until they eventually created an entirely separate language (Hack) and runtime (HHVM).
Similarly, Facebook doesn’t really count as a PHP success story, either.
Something that works well enough for long enough to get you to the point of having Facebook-style scaling problems sounds like one heck of a success to me.
The idea that there is any single tech stack that is well-suited to both the early stages of a project and to “Big Tech” size, and that will “scale” perfectly smoothly the entire way, is just plain false.
Similarly, Facebook doesn’t really count as a PHP success story, either
The problem is that all these people, orgs, companies didn’t choose anything, but they chose PHP. It’s purely speculation if they had success because of or despite the language. Apparently they saw something useful and managed to grow enough without rewriting everything. Others did rewrite everything from language X to language Y, some were successful, some went out of business. You simply can’t tell if it’s a success story, just a story about someone who used it.
Completely the same for every other technology as well, without the power of observing a parallel universe where stuff went different, it’s a moot discussion imho.
Facebook started as a college kid writing a web page for kids in the dorms to rate how hot their classmates were. I doubt it was a well-thought out engineering decision one way or the other.
Completely the same for every other technology as well, without the power of observing a parallel universe where stuff went different, it’s a moot discussion imho.
If you believe that, then why didn’t you post it as a top level comment in this thread to disparage the article for listing a bunch of companies that use(d) PHP?
And whether or not it’s true that we can’t judge whether any of these technical decisions were right or wrong, it doesn’t take away from the point that a company actively choosing to move AWAY from PHP can’t possibly be an argument FOR PHP being good. It might not be a great argument that PHP is bad, either, but it’s a much worse argument to try and convince someone it’s good.
Whenever I see these posts of having to go on the defensive and reference market share, it smells like desperation. It’s the kind of thing you see from any thing that has a “legacy” perception, far less greenfield than it used to have, and entrenched users willing to switch away even if it doesn’t make sense to (trendchasing, how much it costs to rewrite, etc.). You get a lot of insecurity from the userbase as a result.
I say this as a PHP developer… on a minicomputer platform. You see a ton of articles like this in the minicomputer/mainframe space. Again, the technology, be it PHP or z, or whatever else, is good and gets an unfair rap (I’ll defend PHP’s ecosystem quality against current contemporaries, and a lot of those “legacy” platforms still have TCO advantages, etc.), but people get antsy with having their specialty being percieved as on the decline.
I don’t see it as “desperation”, and I’m not sure whether PHP is actually “on the decline”.
I think PHP is no longer trendy among certain niches, but that doesn’t really provide useful information. The trendy bubble – of “Big Tech” companies, startups, and the forums where their employees and sycophants post – is, well, a bubble. The number of people who are out there silently working 9-5 jobs churning out line-of-business apps in “dead” or “dying” languages is, every time I get a glimpse of it, simply staggeringly huge in comparison.
Oh, I fully agree with you. I support those 9-5 LoB programmers churning out not just PHP, but languages far older than that, and there’s a ton of them. Hell, PHP is still taught in schools. It’s just that pieces like these makes me feel you’re not confident in the technology’s future; it feels like you’re acknowledging it by compensating for it. I wonder if they read the same for i.e. CIOs outside the tech industry.
Has not been trendy for 10 years, but I agree with the rest :P
Longer; I remember scoffing at it 20 years ago.
i think it is good to have these kind of links handy during random discussions to share, otherwise you/i need to make these points again and again if someone says php is dead and you should not use it and you don’t want to or can’t ignore.
This part looked a bit weird to me:
Doesn’t PHP also “block the main thread”? As far as I understand the most common way to run PHP is to either let Apache or
php-fpmspawn a bunch of processes that run their own PHP interpreter? Similarly, a production Node.js setup will have multiple Node.js processes running (managed by Nodemon or whatever the kids are running these days), so I don’t see how this is substantially different from your typical PHP setup.If you’re talking about actual threads, yes. But “block the main thread” isn’t a problem in PHP, it’s supposed to do that.
Examples:
All of these isolate each concurrent operation and prevents one operation from blocking another one. Think of this as preemptive multitasking.
Node.js does not do this. It serially processes events in a single process. For this to act as concurrency, each event needs to return quickly or the whole world stops. Basically cooperative multitasking.
None of the others have this specific problem to worry about. Sure, there are limits to the amount of concurrency a process/thread per request system can handle, but none of those concurrent operations interfere with another concurrent operation.
That’s… not a great counterpoint, IMO. That’s not the language doing anything special; it’s just the way we tend to configure our servers. As a language it’s objectively worse than Node.js for blocking the main thread. Also, it’s very common to deploy Node.js systems where we spawn N Node.js processes where N is usually the number of CPUs. Does that mean that Node.js doesn’t have a blocks-the-main-thread problem anymore?
I wouldn’t call it a great counterpoint, but it’s just used differently and I agree more with KayodeLycaon, because iirc it’s actually better than it sounds. The “short-lived forks” are not doing as much, if you look how a SAPI request in PHP looks it’s just kinda dumb and thus it finishes pretty quick, also there is/was also the mpm_prefork, where it’s already in the name.
I agree with what chreke said about the quoted sentence, I wouldn’t have written that like that either.
Also there’s a reason when nodejs came out it was such a hit for stuff like longpolling, it had as a strength in where PHP had a weakness, but some of these things have changed.
I would think most production Node.js setups run multiple Node processes in parallel and load balance between them using either a reverse proxy or something like cluster (at least I hope so!); “blocking the main thread” is not an issue in this case any more than it is in your typical PHP setup.
PHP fans often get this wrong. We PHP critics do not proclaim the death of PHP; we declare that PHP is not a good choice, and defend that critique with principles of language design and implementation (PLDI). The fact that PHP is big and popular is not contested; but we see it as a tragedy.
I think the difference is that no matter if you like PHP or not, it’s a fact that it’s big, that many people use it (for whatever reason) and that it’s here to stay for a while.
That’s not inherently great or a tragedy, that’s just your opinion - unless you read “proclaim death” as a “I wish it died”, which is, imho, missing the point.
Also many people who are raging about PHP (not you) are still stuck in the PHP 4 era, which officially ended in 2008. It got a lot better, but if you think it didn’t get better enough, that’s fair.
But, so what? And that’s only half-rhetorical. Why would someone take the time to write a post about PHP being used a lot? I think the obvious answer is that someone who cites that fact is trying to argue that popularity is correlated with being “good” or at least “good enough”. But, citing the mere fact that it exists and is old is not a compelling case for choosing it. And, as @Corbin said, nobody is arguing that PHP isn’t used by a lot of websites (let’s be honest, though: how many of those are just WordPress where the actual “author” has no idea what PHP even is?). So, what exactly is anyone accomplishing by reminding us of the fact that PHP is still pretty prolific on the web?
At least someone who complains about PHP is actually saying something about PHP directly.
I’m glad you wrote this. I started a much more rambling comment with basically the same gist, but I let it sit before I submitted it, and I’m glad I did. It was a little… fiery because I was really rubbed the wrong way by the quoted sentence. PHP is an awful programming language and I do want it to die. But, it’s not “trolling” when you can back up the criticisms with (many) objective facts. And, before someone chimes in with the tired “You obviously haven’t used PHP since version 7” comment, I still use PHP regularly at $DAY_JOB, maintaining several different projects that are 7+. It’s still terrible and poorly designed.
Something that amused me about the article is the part about Vimeo using PHP. They see that as a success of PHP, but then mention that Vimeo is the creator of Psalm. So… PHP is so awesome that one of the success stories had to create their own static type system and checker from scratch for it! And, if you ever saw Psalm before PHP 8, you’d notice that PHP 8 basically upstreamed some of the type stuff from Psalm and/or PHPStan.
Similarly, Facebook doesn’t really count as a PHP success story, either. They spent ungodly person-hours working on compilers to compile PHP to native code, op cache stuff, etc, until they eventually created an entirely separate language (Hack) and runtime (HHVM).
Something that works well enough for long enough to get you to the point of having Facebook-style scaling problems sounds like one heck of a success to me.
The idea that there is any single tech stack that is well-suited to both the early stages of a project and to “Big Tech” size, and that will “scale” perfectly smoothly the entire way, is just plain false.
The problem is that all these people, orgs, companies didn’t choose anything, but they chose PHP. It’s purely speculation if they had success because of or despite the language. Apparently they saw something useful and managed to grow enough without rewriting everything. Others did rewrite everything from language X to language Y, some were successful, some went out of business. You simply can’t tell if it’s a success story, just a story about someone who used it.
Completely the same for every other technology as well, without the power of observing a parallel universe where stuff went different, it’s a moot discussion imho.
Facebook started as a college kid writing a web page for kids in the dorms to rate how hot their classmates were. I doubt it was a well-thought out engineering decision one way or the other.
If you believe that, then why didn’t you post it as a top level comment in this thread to disparage the article for listing a bunch of companies that use(d) PHP?
And whether or not it’s true that we can’t judge whether any of these technical decisions were right or wrong, it doesn’t take away from the point that a company actively choosing to move AWAY from PHP can’t possibly be an argument FOR PHP being good. It might not be a great argument that PHP is bad, either, but it’s a much worse argument to try and convince someone it’s good.