Hacker News new | ask | show | jobs
by trikko 2453 days ago
Author here. The language switch did the trick! Php code was rewritten some years ago. And we also ported some backend code to c++ to improve performance. Code was not that bad. Php is :)
2 comments

It's so bad that you can build multi billion dollar businesses with it
I certainly don't want to get into the "PHP is a fractal of bad design" vs "PHP is awesome because it runs on a very high percentage of websites, including Facebook" debate. (I have no dog in this race, and I have absolutely no opinion on PHP) But I would ask, are those multi-billion dollar businesses making that much money DUE to their usage of PHP? Or could they run on almost any language/framework and still do just as well? We've heard the stories like "Twitter dropped Rails and rewrote their message queue in Scala, and a lot of their backend in Java"... so I get that there are _some_ scaling stories regarding languages... I just don't think most success stories can be attributed to language choice. Now obviously if you build your entire business on something obscure, and cannot find any competent developers, that's an issue....
That's why I said you "can". As someone who's done c, c++, JavaScript, lisp, prolog, a bit of python, whenever I see people saying such and such language is bad (like trikko's comment), it just strikes me as immature. There are way bigger factors that determine the success or failure of a project yet somehow I keep hearing developers fixated with the idea that the language alone will make or break the project.
Also with drug, weapons, etc. you can build multi billion dollar business, so? Should we give up with good programming practices and join Mafia?
PHP and good programming practices are orthogonal. Nice try at hyperbole, though.
Would I be right to assume that your PHP was version 5.x and you didn't do the upgrade to a 7.x release? PHP made enormous leaps and bounds in terms of performance starting with 7.0, and has subsequently been improved in each of 7.1/7.2/7.3. It even has JIT coming in the next version. One fact: PHP 7.0 started to closely match–and in some cases beat–the performance of HHVM (Facebook's PHP replacement); so even Facebook could likely run on the latest PHP rather than their custom solution.

Personally, if I switched away from PHP for web development these days I would do the backend in Go. But thank you for teaching me something new today. SCGI is not a protocol I'd heard of before, what with FastCGI being the (horribly legacy) standard. I have something new to research. :)

No, we did the upgrade to php7.0 and then 7.2 when 5.2 lifecycle reach its end. It doesn't take so much work, and we see an improvement as well.

I love scgi because it's clean and easy to implement. And it works fine for our use cases.