Live data from Hacker News

Why so much hate for PHP?

news.ycombinator.com

21–30 of 74 posts

Re: Why so much hate for PHP?

#21
PHP is AWESOME! Because there are so many examples of how to do everything. If you are building a web app you need HTML anyway , and since PHP is like 75% knowing HTML you are a long ways to knowing how to do things. PHP is fast enough for 90% of websites. LAMP is a commodity you can get any hosting provider to set you up in seconds.

PHP is SUCKY! Because it is way to slow for 10% of websites. 90% of coders pieced together their solutions from a mish-mash of code examples they found on the web. HTML is just strewn through out because most people do their PHP inline with the HTML rather than populating variables to output all at once. LAMP has the word Apache, and MySQL in it and that means you inherit some badness that is being sold as a commodity (yeah you can run on a non-lamp but very few who do PHP do, and so you may not be compatible if you stray from LAMP which means you are writing in a non-standard way)

Re: Why so much hate for PHP?

#22

Essentially because it wasn't a well-thought out language, but a hack, it became used widely, but that lack of thoughtfulness shows on larger projects quite a bit. It is a hack that need to become more formalized with time, but it hasn't quite done that. Whenever I still see "needle" and "haystack" in documentation I think "Wait what is this? Oh right..." >Facebook uses it Not really, I mean Facebook doesn't use the…

I assumed they use ejabberd, or some modified version of it, I'd be interested to know if they built their own erlang chat-server in-house.

Re: Why so much hate for PHP?

#23
post #6
post #2

A quick dive into any PHP-related topic on HN should yield significant answers. Part of the hatred comes from the fact that the way people know PHP is from 2005, when it was essentially one really long procedural program. It's not so much that people ignore the recent upgrade in tooling/modern language constructs so much as people aren't familiar that they exist. However, these is still a lot of vitrol for PHP. Becau…

> Ruby is hilarious slow, for example. [citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.) [1] https://stackoverflow.com/questions/2529852/why-do-people-sa...

Developer Productivity in Rails means having a self-righteous excuse for hard-coding vital, tunable elements of your app and pretending you didn't just do that. A rails app is constantly under "development" because so much of it is just plain hard-coded in place under the guise of MVC and its single model of persistence: Active Record. Down-vote all you want. We've reached the turning point where you hear far more about big companies moving from rails, than switching to it.

Re: Why so much hate for PHP?

#24
There are a number of reasons why PHP is so disliked by outside communities including but not limited to MAGZine's points.

1) As mentioned there are a number of language inconsistencies, much more so than comparable languages. This includes naming schemes for functions

2) PHP and most major projects written in it are insecure. Even up-to-date Wordpress installs are vulnerable to attacks.

3) Testing still isn't in vogue. Few projects have any testing and for those that do the testing tools aren't nearly as strong as in other languages

4) The tooling that surrounds the ruby, python, go, javascript languages is much more advanced than what PHP has even now. PHP only really got a decent package manager last year.

5) For a long time most PHP projects were procedural. Real OO was only introduced in PHP 5.

6) There is a lot of bad code written in PHP because it was so accessable.

7) Most examples of PHP projects are CMS' which don't require a ton of experience to build. You meet a lot of people who have spent 10 years in the industry that really have just managed content that don't know how to build something complex and don't have any background in data structures, algorithms etc

8) The PHP community is extremely fractured. There are something on the order of 10+ major PHP frameworks. Zend, Symfony, Codeigniter, Cake, Laravel, Kohana, Yii plus a number of more minor frameworks like Lithium, Silex etc before you get to the CMS' like Joomla, Wordpress and Drupal

Re: Why so much hate for PHP?

#25
IMHO, PHP is hated and misconsidered because: Since a few years ago, it was mainly used by amateurs. The truth is that PHP, right now, is a very appealing and competing language. I know several companies that power their services with PHP and it just makes wonders.

Of course: you need to know what you are doing. But the language itself is capable of doing almost everything, without drawbacks.

Lot of people make clueless claims about how PHP is worst than (place-latest-cool-framework/language-here). This is far from being true, read this: http://philsturgeon.co.uk/blog/2013/11/benchmarking-codswall...

So, PHP is hated in the devs world because it gave access to "amateurs" to the world of crafting software. Which is ridiculous.

Re: Why so much hate for PHP?

#26
post #2

A quick dive into any PHP-related topic on HN should yield significant answers. Part of the hatred comes from the fact that the way people know PHP is from 2005, when it was essentially one really long procedural program. It's not so much that people ignore the recent upgrade in tooling/modern language constructs so much as people aren't familiar that they exist. However, these is still a lot of vitrol for PHP. Becau…

I'm surprised people aren't quicker to mention the fact that PHP was (and still is!) responsible for many simple SQL injection database dumps/hacks. A simple string termination was all it took. That I felt gave PHP a massively bad rap as they spent versions after that trying to figure out a way to prevent/deter it.

Nowadays with wrappers it's thankfully less of a problem.

Having just come off a Drupal project myself but having looked at the latest PHP additions as well as Laravel though, it seems to me that many languages are converging and borrowing from each other, which I love. Latest PHP is pretty sweet.

Re: Why so much hate for PHP?

#27
post #6
post #2

A quick dive into any PHP-related topic on HN should yield significant answers. Part of the hatred comes from the fact that the way people know PHP is from 2005, when it was essentially one really long procedural program. It's not so much that people ignore the recent upgrade in tooling/modern language constructs so much as people aren't familiar that they exist. However, these is still a lot of vitrol for PHP. Becau…

> Ruby is hilarious slow, for example. [citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.) [1] https://stackoverflow.com/questions/2529852/why-do-people-sa...

Been a Ruby programmer for 5 years now and I find that this is dodging the issue. Sure the productivity is higher but what happens when you're finished developing and your code is now running in production? What happens when it's slow at serving requests, slow at any form of computations, slow when a rake task is starting?

Talking about productivity is a good thing because raw "power" doesn't mean anything, but I really wish we could admit publicly that Ruby is really not a race horse. It does other things awfully well and I wouldn't trade language for the world, but man, I wish it could get a free speed jump like Javascript got a few years ago.

Re: Why so much hate for PHP?

#29

TL;DR: Because we used it. Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things. Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me r…

I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
Post reply on HN