by 29athrowaway · 6y ago · 0 comments
I guess at least 80% of web traffic would go to the Alexa top 100 sites. How many of those run on PHP? There was a time where many if not most of them ran on PHP, but today many have migrated away from it for performance reasons.
Wikipedia?
Wordpress?
Tumblr?
Large chunks of Slack?
That's a lot of traffic.
Fun fact: Companies typically leave PHP not for performance reasons (it's faster than Python and Ruby, for example) but because it's hard to hire people who know PHP since there's a strong bias against it.
(To be fair, I was one of those anti-PHP people, but after seeing PHP7, Laravel, etc, I acknowledge it's vastly improved from the early 2000s).
We got around that by hiring language-agnostic. Laravel is such a well designed framework we had no issue getting people contributing week 1, while continuing to expand their knowledge of the framework over time.
99% of users only read articles and blog posts, which is content that can be aggresively cached. If the workflow was not as cache friendly, they would not be using PHP, for sure.
Does it compare favorably or equally to most interpreted languages? Yes, it is not an outlier in performance (and tends to be one of the fastest cause of all the tuning it's had from use at high load companies). And yes, large chunks of the code in these companies still, today, run PHP. I guarentee you Wikipedia's global editor activity is higher than you think it is. Same with Tumblr and Slack's entire channel communication pipeline (which was an offshoot from Glitch).
It generally scales better than Ruby and Python. You can write shitty code in all of these languages and you can write clean code in all of these languages. And every language has it's warts (Python, which I LOVE and had a startup built around it, is FULL of these warts too).
The average person working on PHP applications cannot write a multithreaded socket server and do not understand TCP. They don't know how things work and what to do when they don't.
Their mental model is based on self-evident truths such as "Laravel is good because Laravel is good" and "PHP is good because PHP is good", but as soon as you ask why, they cannot really ellaborate in terms other than "because it's good". It's a cargo cult.