3 ms·
Facebook? (I know, it's technically HHVM but the language is basically PHP) Wikipedia? Wordpress? Tumblr? Large chunks of Slack? That's a lot of traffic.
by nickv 6y ago
Facebook? (I know, it's technically HHVM but the language is basically PHP)
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).
- 29athrowaway 6y agoWikipedia and Wordpress have massive reverse proxy caches in front of their PHP servers. Those servers are the ones that handle most of the load. 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.
- deleted 6y ago[deleted]
- nickv 6y agoAgain, is it as performant as compiled/byte code languages like C, Java, GoLang? No. I'm not making that statement. This is why most real reverse proxy caches are not written in Ruby or Python. 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).
- 29athrowaway 6y agoPHP has almost the verbosity of Java. For the same amount of effort you get less performance and access to inferior tooling for debugging, profiling, testing, static analysis, etc. 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.
- nickv 6y agoYou realize you are stereotyping a large group of people. You also know absolutely zero about modern day PHP, it seems. Let's argue about Perl 4.19 while we're at it. I assure you the actual writers of Laravel know why Laravel (or Lumen) is good and why they made decisions they made. I promise you the Facebook PHP engineers who worked on HHVM and Hack know best practices and PHP really well (and know how to write a multithreaded socket server and understand TCP). I also promise you that there are engineers that work all over the place (like non pure tech companies like banks and insurance companies) that don't look at Java as craft. They use Spring cause it's "good" and have written the DAO pattern 100s of times cause it "works". I bet the vast vast vast vast majority of Java Spring developers have not read Rod Johnson's Expert One-on-One J2EE Design and Development and actually understand WHY Spring was invented. Knowing Java doesn't create some magical space where you suddenly know the TCP protocol state diagram. That's just a silly statement. I promise ANY average developer of ANY language can NOT spit out a bare metal implementation of TCP. Hell, I bet the average Java developer doesn't know the difference between UDP and TCP (or the average php developer, average python developer, average ruby developer, you get what I'm saying) PHP is a language. One that is as performant as it's peers, has a large presence on the internet, and is battle-tested. If you instinctively shit on PHP developers, that's something you need to work on. And, just to be clear, I don't CODE IN PHP and never have. I just know people who are brilliant who do and also deal with some PHP buried in my company to this day (like pretty much every tech company).
- derision 6y ago> because it's hard to hire people who know PHP 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.