Why so much hate for PHP?
1–10 of 74 posts
Re: Why so much hate for PHP?
#2However, these is still a lot of vitrol for PHP. Because it is so easy to use, many people are able to pick it up without any prior SE experience--these people tend to create poorly-designed, slow-running, and, perhaps worst of all, dangerous (vis a vis security) code.
The other major complaint that exists has to do with inconsistency/insanity in PHP's function signatures/naming/evolution. For example: mysql_escape_string and it's sister, mysql_real_escape_string. Although, anyone working with modern PHP probably will never touch these functions.
What is overlooked is that it has an extensive base of developers, it DOES scale (this is proven), and the language is improving (as well as the tooling (PHPUnit, XHProf, CI tools), frameworks, package management etc). And although Facebook does use it, it's important to note that, AFAIK, PHP only exists as a thin layer in between "display HTML" and "communicating with backend servers which are going to handle the majority of the work, save for presentation-layer type stuff."
There are a few alternatives to PHP, but they each have their warts too. Ruby is hilarious slow, for example.
Re: Why so much hate for PHP?
#3A 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…
Re: Why so much hate for PHP?
#4>Facebook uses it
Not really, I mean Facebook doesn't use the PHP that a common person uses.They've made so many changes and their codebase is so huge. Facebook also uses the D programming language, HipHop, and probably more tools than I'll ever know. Wasn't chat at Facebook first written in Erlang?
Re: Why so much hate for PHP?
#5A 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…
Thanks so much for your time! I was wondering whether you would suggest using PDO or mysqli for connecting to mysql via PHP?
Re: Why so much hate for PHP?
#6A 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…
[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...
Re: Why so much hate for PHP?
#7Essentially 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…
Re: Why so much hate for PHP?
#8PHP a fractal of bad design: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
Re: Why so much hate for PHP?
#9Anything can be hacked around, of course, as Facebook has proven. But you could write Facebook in Bash or DOS Batch Language if you were willing to. But newer frameworks and languages that were designed with modern web development in mind are more to a lot of people's liking than PHP's style.
Really, the best way for you to answer your question is to dig in and learn how to develop a webapp using Ruby or Node.js or Python and the amazing frameworks that are built on those languages. Dig in for a couple of years and then on the other side you'll understand better. You may still prefer PHP, but even if you do, I'll bet the PHP code you write will be better for having learned how the "other guys" do things.
Re: Why so much hate for PHP?
#10PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant. But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opinions on anything and no exciting concepts or language features. Now you can use great frameworks that implement great ideas in PHP, but because PHP has been around for a long time, much of the code out there and still in production is spaghetti code that is no fun to work with and the only option to change that is often a complete rewrite.