6 ms·
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 o
by twunde 13y ago
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
- crazytony 13y agoNumber 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.
- twunde 13y ago2006 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.
- padraicb 13y ago1) 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) PHP 5 was released 10 years ago. Give it up already about procedural code. 6) Agreed. 7) Not my experience. 8) PHP has a massive community. Ergo, it has a long tail of frameworks. I seem to remember that Ruby has had more than one.
- twunde 13y ago2)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