3 ms·
As far as prominent products, besides WordPress, Facebook, and Wikipedia, Slack and Mailchimp are (were?) also PHP. (I googled and apparently a prominent '-hub'
by firasd 7y ago
As far as prominent products, besides WordPress, Facebook, and Wikipedia, Slack and Mailchimp are (were?) also PHP. (I googled and apparently a prominent '-hub' site uses it too.)
The PHP hate never made sense to me in the context of the rise of Node.js:
* In PHP I've never accidentally combined 2 + 0.3 into 20.3
* I dislike the cowboy-ish over-use of ternary operators and short-circuiting by JS devs (random example from StackOverflow: var bar = data.bar !== undefined ? data.bar : 'default'; )
I appreciate that JS has functional-programming aspects that make it appealing though.
It's interesting that when PHP alternatives like Rails came around I saw a lot of anti-Java sentiment online, but now when Rails-based companies have to scale they end up using Java or JVM-based infrastructure. So trendy online sentiment shouldn't really inform best practices for various teams at various stages. (I notice that a lot of NoSQL hype seems to have died down since 2015...)
Perhaps the best commentary about why people succeed with PHP is this HN comment from a couple years ago: https://news.ycombinator.com/item?id=12704094 https://news.ycombinator.com/item?id=12704094
If you're programming in PHP, you're not running around talking about "convention over configuration" giving talks, or trying to make your code beautiful... You're incorporating feedback while the other guy is just starting to get to work. When he finally fails, he's used up half his runway, whereas you, the guy who didn't give a fuck about your code has gotten past that first failure, and are finally getting some traction.
- dijit 7y agoas my friends will attest, I'm not the largest fan of PHP. But it's not the language it was, it's much better these days; and it was always very fast for an interpreted language. I really cannot agree with you more that for all the hate PHP gets, javascript is a thousand times worse. I figure the major difference is the ecosystem surrounding javascript. The tools are super great and writing multi-threaded/async code is very easy. But I say this as a person who avoids both PHP and Javascript, so I might be talking nonsense.
- wildduck 7y agoI have being using PHP since it was call PHP - Personal Home Page. The best part of the PHP is the templating! It makes a lot more sense then Perl at the time. Now days templating can easily be replaced by EJS. Personally I wouldn't want to use any language that does not have closure and function as a first class citizen. It makes programming fun and productive. BTW, the 2 + 0.3 thing you are mentioning are all fixed by ES15 and ES6.
- LeonM 7y ago> BTW, the 2 + 0.3 thing you are mentioning are all fixed by ES15 and ES6. Meaning that they broke a lot of code when they did that. Not that it matters that much, since it often impossible to build a JS codebase that is over a year old without major refactoring.
- adventured 7y ago> The best part of the PHP is the templating! I've used PHP for about 15 years give or take, off and on. Before that I variously used Perl, ColdFusion or ASP for fairly routine Web services. Mostly I use PHP for straightforward CRUD work, for which it is very well suited. I'm currently using it for what is effectively a glorified CMS system. It's perfect for the task, I essentially never encounter something in PHP that causes me consequential problems within the lane that I'm using it. Although had they not dramatically boosted performance with the 7 releases, I might have opted for something else at this juncture.
- lifthrasiir 7y ago> * In PHP I've never accidentally combined 2 + 0.3 into 20.3 But PHP thankfully combines `md5("PHP") + 1` into 3. Sounds legit. I think Slack's own anecdote [1] is a better characterization of PHP nowadays. Hint: they don't disagree that PHP was (and to the lesser extent, still is) a terrible language. [1] https://slack.engineering/taking-php-seriously-cf7a60065329 https://slack.engineering/taking-php-seriously-cf7a60065329
- ma2rten 7y agoCould someone please explain both the 2 + 0.3 and md5("PHP") + 1 thing?
- adimitrov 7y agoAutocasting. Autocasting was a cool and newbie friendly idea in principle. It just turned out to cause such horrible bugs in real code that no sane person would still argue its merits. It also leads to stupid notions of thruthiness (google Gary Bernhard's WAT talk) and bad junior dev behavior. I've seen a popularish PHP framework document the return value of a function al boolean, but the actual return value was the string "0". It wasn't even a by prduct of the implementation. They just explicitly used return "0" for no good reason.
- scandinavian 7y agoFacebook forked PHP (Hack) and slack transitioned to hack (or is still in the process of). Mailchimp seems to be looking for Go programmers for backend work, so not sure that PHP is the major language of their stack anymore. So not the best examples.
- joelbluminator 7y ago"but now when Rails-based companies have to scale they end up using Java or JVM-based infrastructure." Ya, Shopify begs to differ with you on that one. It's trendy to migrate a dynamic language to typed one because that's the first thing some CTO's who came from typed background want to do...it's hardly about scaling imo. Isn't Shopify proof Rails can scale?
- kyriakos 7y agopornhub is 100% PHP. some URLs don't even hide the fact that they are .php scripts.