Live data from Hacker News

Ask HN: Why does PHP "suck"?

news.ycombinator.com

1–10 of 13 posts

Ask HN: Why does PHP "suck"?

#1
Let me be clear: I'm not a PHP hacker, I don't use it and probably won't have an immediate need for it. However it's been my perception that many people have a strong opinion about PHP. I'm wondering what specific technical reasons there are for this?

(Please excuse me if this isn't the right method for asking these kinds of questions.)

Edit: I don't actually have an opinion, in other words I don't think it "sucks", but I'm hoping that some of you might be able to address that "PHP sucks!" line I read so often.

Re: Ask HN: Why does PHP "suck"?

#2
It doesn't.

You're right, this isn't the right way to ask these questions, and since you obviously recognized that, I can't imagine why you didn't bother to try to come up with a less inflammatory way of asking the question.

Re: Ask HN: Why does PHP "suck"?

#5
post #2

It doesn't. You're right, this isn't the right way to ask these questions, and since you obviously recognized that, I can't imagine why you didn't bother to try to come up with a less inflammatory way of asking the question.

My apologies. Perhaps I should delete this post?

Re: Ask HN: Why does PHP "suck"?

#6
I know HN ist not place to prais php... PHP ist easy to learn and it easy to code in php, but if your a professional software developer you can also write professional software for php.

You can develop faster, because of large amount of built-in functions and classes. The "shared nothing" philosophy makes it almost unbeatable in terms of performance. Thats why a majority of large sites like Facebook, Wikipedia, Yahoo and Flickr is powered by PHP.

Well php is not as structured as ruby or python. Sometimes it is not structured at all. :-(

Other HN users would certainly talk about disadvantages of PHPafter my comment. ;-)

Re: Ask HN: Why does PHP "suck"?

#8
post #5
post #2

It doesn't. You're right, this isn't the right way to ask these questions, and since you obviously recognized that, I can't imagine why you didn't bother to try to come up with a less inflammatory way of asking the question.

My apologies. Perhaps I should delete this post?

Or edit it perhaps and make it a little less condescending.

Re: Ask HN: Why does PHP "suck"?

#9
post #6

I know HN ist not place to prais php... PHP ist easy to learn and it easy to code in php, but if your a professional software developer you can also write professional software for php. You can develop faster, because of large amount of built-in functions and classes. The "shared nothing" philosophy makes it almost unbeatable in terms of performance. Thats why a majority of large sites like Facebook, Wikipedia, Yahoo…

Please explain how you consider it 'less structured'. I admittedly don't work with much PHP any more, but it has namespaces, classes and objects.

I can write linear Python just as ugly as anything a PHP developer could come up with (probably). And I could write MUCH more destructive C code than anybody in PHP could (probably).

If you mean it's less structured because of Rails or Django, I'd submit that PHP has CodeIgniter, Zend, and a bevy of other frameworks that all seem to be pretty solid to an outsider looking in.

Re: Ask HN: Why does PHP "suck"?

#10
Yes...it sucks so much, that Facebook used it to scale a network worth $50 billion dollars today.

From a coding perspective, it is a very "loose" language (not that kind of loose). This has advantages and disadvantages, depending on what you are doing.

It is very easy to learn, and therefore there is a large degree of stratification with PHP devs. Professional coders turn their nose up at PHP, because it is kind of like telling Tiger Woods that you play golf. Maybe you do...but you don't play his game of golf. It's more impressive to say you code in a language that is difficult to do well, and that will punish you badly if you don't code in it well. PHP is pretty forgiving, even for pretty crappy code (I've seen some pretty awful stuff).

The truth is that PHP is a great web language. Rails and other frameworks provide tighter integration with the db and view layers, but this isn't necessarily a good thing. PHP allows for that level of integration if you want it (as mentioned, there are many PHP based frameworks). It also happens to have a large, open source code base that is reviewed by many, many eyes, so bugs get fixed quickly and the language evolves quickly. The help manual is superb, and it performs well across hardware platforms.

You will hear many baseball fans saying the other team's players suck. Most of the time it isn't true.... it's just a pride thing.

Post reply on HN