> Most developers who hate PHP hate it out of elitism or ignorance. Either way it’s dumb. You have to choose a technology based on what you need. PHP is highly useful and powerful in many scenarios. And taking it out of the equation just because of its reputation is not a good idea. When I conduct hiring interviews, one of the questions I like to ask regardless of the language for the position, is the developer opini…
its fun to trash talk PHP who cares if statements are accurate. PHP sucks because of the dollar signs everywhere. From a distance Wordpress code looks like Nigerian Prince emails. And crazy coding conventions like mysql_real_escape_string. Really PHP?
Why Developers Hate PHP
71–80 of 114 posts
Re: Why Developers Hate PHP
#72> Developers hate PHP because you are more likely to get errors with a language that allows so much freedom. Ruby gives you much more freedom than PHP. You can reopen classes, you can use any kind of object as a key in an associative array, you can write code that will execute when the class (not the instance) is being created. And yet I find it much easier to write stable code in Ruby. > Developers hate PHP because…
php > $array = [1,2,3,4]; php > var_dump(array_filter($array, function($x) { return $x %2 === 0; })); php shell code:1: array(2) { [1] => int(2) [3] => int(4) } what's the problem with array_filter then? That keys are not reindexed?
if (!empty($filteredArray)) { print($filteredArray[0] }
But in PHP I need to remember that after every array_filter, after every unset etc. I need to reindex the array, because [0] element might not be thereRe: Why Developers Hate PHP
#73Earlier quoted context omitted.
That goes for any question in interviews. I expect honesty and I'm straightforward about it.
This is not really a question like any other, because it's a very polarizing one. It's fair to intentionally ask polarizing questions if the objective is to find how if a candidate can take moderate positions in those contexts, but it's definitely not like "any question in interviews".
Re: Why Developers Hate PHP
#74There is no web framework out there which comes with such elegant concepts, syntax and feature-richness like Laravel. I have seen them all - Laravel is incredibly good, especially for small - mid sized projects! And this statement comes from a python guy.
I have spent the few days trying to get into Phoenix and as interesting as it is, it would require me to re-invent the wheel for a lot of things that laravel just offers you out of the box. a quick example is subdomain based routing or even its robust notification based system.
For all the hate laravel gets , it level of productivity is unmatched once you know yor way around it.
Re: Why Developers Hate PHP
#75There is no web framework out there which comes with such elegant concepts, syntax and feature-richness like Laravel. I have seen them all - Laravel is incredibly good, especially for small - mid sized projects! And this statement comes from a python guy.
I'm convinced that Laravel and PHP are (literally!) best-in-class for the user-facing web layer of any HTTP based application. The tooling, resources, first party libraries, and general ecosystem is VERY evolved, and the framework can makes you VERY productive.
Re: Why Developers Hate PHP
#76I don't like having to hold 'shift' while pressing '4' all the time. Other then that I don't think the language is bad and where you cannot do what you're needing to do. If only I could get rid of the need for $ signs everywhere.
at least you don't have $ # and @ to determine object vs list vs. hash map like perl5. :P
Re: Why Developers Hate PHP
#77The Zend APIs suck, and they have non-existent or severely outdated docs. For example, one of PHP's main internal data structure, zend_hash, is a weird hash table with a string / int union key type and is awkward to access or iterate over.
Memory issues. I've had to debug segfaults caused by memory bugs in the language and core libs more than once. For example I hit an uninitialized read error in mbstring, it's been in their bug tracker since 5.x and never fixed. I understand the normal way to deal with memory errors in PHP is to shrug it off because processes are short-lived but if you are security-conscious it is concerning.
Compared to that, working on similar integrations for Python, Java, Node.js, the number of times I've hit such bugs is exactly zero. PHP just seems to have lower quality and worse design overall.
EDIT:
CVE database agrees with my assessment, so many more memory issues in PHP:
PHP: https://www.cvedetails.com/product/128/PHP-PHP.html?vendor_i...
Python: https://www.cvedetails.com/product/18230/Python-Python.html?...
Java: https://www.cvedetails.com/product/19117/Oracle-JRE.html?ven...
Re: Why Developers Hate PHP
#78PHP is my favorite language to write SQL injection vulnerabilities, just like C is my favorite language to write pointer bugs. (Disclaimer - The last time I used PHP was over a decade ago, and the last time I used C was in college)
Re: Why Developers Hate PHP
#79PHP being awful annoys me so much more than javascript being awful. At least for the latter the use became mostly unintentional. For PHP, the problem is that it came about at just the right time to be picked up by WordPress and Facebook, hence encrusting itself in most of the web we see. I dislike WordPress the same way I came to dislike Visual Studio or any other monstrosity. It's a slow, massive, lumbering mess but…
> For PHP, the problem is that it came about at just the right time to be picked up by WordPress and Facebook, hence encrusting itself in most of the web we see. That's backwards in my opinion. PHP was successful among non-CS-people, and those people started building things they were interested in. That gave PHP the initial success (especially on the web, were plenty of people didn't have a CS background unlike in en…
The "phase II" version in PHP was written by Magnus Manske (who is indeed a non-CS-person).
Re: Why Developers Hate PHP
#80Earlier quoted context omitted.
PHP always struck me as a language that had very haphazard beginnings and initial design considerations that continue to cause it problems, but less so as time goes one, that has made mostly good and well thought out decisions since then (and possibly because of that). The base language functions are a train wreck of multiple functions doing similar things that could easily be handled through a few slightly more flex…
You're right. And if you told me anything along those lines during an interview I would smile wide open knowing you speak from experience and not from prejudice.
Someone that rabidly comes to the defense of PHP in an overly negative way towards others will also probably raise red flags, and the people that are prejudiced against PHP but at least smart enough not to put their their mouths when talking to others come across better, which they probably should, since team relations/compatibility is also often an important part hiring.
It's hiring, which is just hard. Give the candidates enough tests to generate as much useful data as possible, and then make some gut decision you hope is based on real indicators and not your own biases, and hope for the best. :)