Hacker News new | ask | show | jobs
by justinlardinois 3542 days ago
PHP was the first programming language I ever used, so it holds a special place in my heart. And I use it daily at my current job.

I have to disagree with this article. PHP is a heavily flawed language. It's very easy to get started with PHP, but there are too many pitfalls that are too easy to fall into.

Most of the "Virtues of PHP" are available in other web languages if you use the right framework. And if you use those languages you'll benefit from the consistency and predictability that come from having a clear design philosophy from the start.

I don't think PHP is a bad language. It's possible to write good software in PHP, and it's possible to work around the flaws if you really know what you're doing. If your software is already written in PHP, it's probably not worth it to throw it out and rebuild it in something else. But I don't think it's worth the trouble if you have a choice, and I think writing new software in PHP should be avoided.

I'll admit I'm not familiar with HHVM and Hack. Maybe they alleviate PHP's problems.

P.S. Most of the points under "The Case Against PHP" are also issues with Javascript. But the difference is that if you're developing a web application, you have to use Javascript. You don't have to use PHP.

1 comments

Zero startup time and a serious JIT aren't actually available in Python or Ruby even after all these years.

I would be hesitant to dismiss the significance of those - although I'm admittedly biased, having worked with Keith previously as well as on an erstwhile "competitor" to HHVM (talariatech.com).

> Zero startup time

My pretty heavy Django app takes about half a second for Gunicorn to boot 6 workers then it's off to the races. That might as well be zero startup time.

Similarly many of the node apps I've worked with have about a half second or less of startup (unless pre-warming database connections, that takes more time).