Live data from Hacker News

Ask HN: Why do people hate PHP so much?

news.ycombinator.com

21–25 of 25 posts

Re: Ask HN: Why do people hate PHP so much?

#21
Take your pick (probably a combination of the below):

1) it is more popular then what they are using, developing or have skills for

1a) they use language x which does something different that they feel PHP sucks because the lack of it.

2) they got stuck using it and prefer language y instead.

3) They really aren’t all that good programmers and rely on pre-implemented security features to save their butts, and PHP doesn’t meet their dependencies

4) they are invested-in or represent language/platform x and PHP is a compelling contender.

5) they prefer to argue instead of fostering as accessible/usable alternatives for for one reason or another

Just as COBOL, FORTRAN, Visual BASIC, Perl, etc. are reviled by some, they still get jobs done. In some respects it may suck, others it's just fine partly based on intended application and/or coding skill.

If PHP was so bad in all the respects argued, there would be a much more compelling alternative, but it isn't all that bad, and actually quite useful... and popular.

Re: Ask HN: Why do people hate PHP so much?

#22
I've asked the same question before, and the answers I've received are basically:

A) People like to compare frameworks (e.g. Rails) to the PHP programming language, rather than an apples-to-apples comparison, and therefore PHP always falls short in their eyes.

B) The abundance of poorly written, insecure legacy code has besmirched PHP's reputation beyond repair, even if its actual security isn't bad.

C) The fact that n00bs can pick it up quickly and get a dynamic website out of PHP with minimal effort leads elitists to look down on it from their glass enclaves.

D) Academic reasons that no one outside academia cares about.

Full disclosure: I read and write PHP every day regardless of what people say about it. :D

Re: Ask HN: Why do people hate PHP so much?

#23

Mostly because the legacy of PHP as a toy project carried forward forever. Here's a great tidbit about why all the original functions have ridiculous, inconsistent naming schemes: > "Well, there were other factors in play there. htmlspecialchars was a very early function. Back when PHP had less than 100 functions and the function hashing mechanism was strlen(). In order to get a nice hash distribution of function nam…

The "Personal Homepage Program" certainly grew organically. Many experienced developers prefer a much more structured approach to defining a language and environment, one with more consistent naming schemes. PHP cannot escape its roots -- it was doomed from the start in this regard.

Re: Ask HN: Why do people hate PHP so much?

#25
post #16

PHP gets a lot of hate because of internal inconsistencies and sometimes bizarre pass-by-reference semantics, but I mostly get annoyed at how dog slow it can be. When PHP is fast (and it often is!), it's because the functions you're using are written in hand-tuned C. The kind of "modern PHP" that I write professionally (think Java or C# without types or a compiler) is often disappointing performance-wise. HHVM is slo…

I don't buy the whole "slow" thing. I work on a very popular SaaS web app, written in PHP, that is running on far fewer frontend web servers than I've seen running other sites with fewer users written in other languages.

With an Opcode cache (available shipped since 5.5) it's perfectly fine performance wise.

Post reply on HN