Live data from Hacker News

Why so much hate for PHP?

news.ycombinator.com

71–74 of 74 posts

Re: Why so much hate for PHP?

#71
post #5
post #3

Earlier quoted context omitted.

Thanks so much for your time! I was wondering whether you would suggest using PDO or mysqli for connecting to mysql via PHP?

From my personal experience I would suggest working with PDO. It is easy to implement, supports multiple drivers if needed and has named parameters in your prepared statements. The difference in terms of performance should be insignificant - although I think in some cases mysqli tends to execute faster.

It also has the merit for Perl developers of being more or less like Perl's DBI.

Re: Why so much hate for PHP?

#72

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 cluel…

I think that it is great that "amateurs" have a usable tool. I did have a grudge against PHP, derived from having maintained a system written in that fashion. Do I really care one way or another? No.

Re: Why so much hate for PHP?

#73
post #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 vog…

1) Agreed. 2) Citation? PHP is extremely popular so it has more insecure code in comparison to Ruby. Also Rails isn't above multiple security vulnerabilities per year so I don't see how Wordpress (which incidentally is an extremely old application) could be. 3) Testing is extremely popular these days. It's 2014, not 1999. 4) Agreed. PHP finally got shut of PEAR and Composer has had an unbelievable impact on PHP. 5) P…

2)Within the past 6 months I had a wordpress install, which was up-to-date used in a DOS attack against someone else. PHP also does some surprising type changes that can be exploited. That plus people remembering the mysql_real_escape crap leaves people with a poor impression of PHP security.

3) It's definitely much better but still doesn't compare to the ruby or node communities. I think the biggest changes to the community will be a bigger focus on testing/TDD and facebook's HHVM

5)True. Wordpress and Joomla are extremely old applications. However Wordpress is still extremely popular, which is why I bring it up.

7) Would you mind adding what your experience has been? I'm genuinely interested.

Ruby really only has 2 main frameworks: Rails and Sinatra. Python and Node are more fractured, but there are generally a few main frameworks

Re: Why so much hate for PHP?

#74
post #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 vog…

Number 3 is the reason we moved our last PHP "backend" to Java ages ago (2006). I'm surprised it's the first mention I've seen of it here.

2006 was a while ago. Testing is still not expected in PHP but the modern frameworks have testing available even if the culture surrounding it is rather weak.
Post reply on HN