5 ms·
> 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
by hu3 6y ago
> 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 opinion on PHP.
It's not uncommon for some to start massive rant based on outdated or outright wrong statements about PHP. Most of them never even used PHP.
It's a nice question to filter out elitists. The best candidates usually answer either "can't say because I have never used PHP" or state pros and cons of PHP based on their experience.
edit: quick -3 downvotes. I suspect I hit a nerve in some elitists who would not get that Rust or Haskell position because they would have baselessly trashtalked PHP in my interviews.
- winrid 6y agoThey might think you expect them to dislike it. Also, maybe they fear if they say they like PHP you'll take points off.
- hu3 6y agoThat goes for any question in interviews. I expect honesty and I'm straightforward about it.
- pizza234 6y agoThis 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".
- hu3 6y agoFair enough. It's not comparable to just any question. But hear me, you have to poke the bee's nest with some polarizing questions to really know what's inside otherwise you're stuck hiring an unknown until it's too late and costly (for both parties) to find out they were not a good match.
- winrid 6y agoI'm not saying don't ask it. If anything it can reveal personality issues like any question. Just saying as a statistic it's not reliable. :P
- msla 6y ago> It's not uncommon for some to start massive rant based on outdated or outright wrong statements about PHP. If they make wrong statements, I agree, they shouldn't do that. If they make outdated statements... well, what would you expect from someone who used PHP in the past and then stopped using it? Do you expect people to stay up-to-date on a language they no longer use? If so, why, and can you think of reasons they wouldn't?
- hu3 6y agoIt's not a boolean judgement for sure. There's a spectrum between hating a technology for the sake of it (elitists) and just stating outdated info about a technology which is passable. As with any interview, one question alone rarely filters out candidates. They weight on the result.
- kbenson 6y agoPHP 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 flexible functions (e.g. the numerous array specific functions), and there's little consistency between types and orders of arguments in the base functions of the language, but the class and object system seemed very sane and easy to work with as of somewhere in the 5.x timeline, especially compared to Python and Perl. I haven't used it much since about 2011, but I imagine it's better since then, not worse. > It's not uncommon for some to start massive rant based on outdated or outright wrong facts about PHP. Most of them never even used PHP. It's a nice question to filter out elitists. Even with all I said above, I think you might also be filtering out some people with a little bit of PTSD instead of elitists (but that might not be a bad thing for hiring). A lot of people started with PHP and might have moved to other languages when they became upset with some of it's real deficiencies, when those deficiencies composed a larger portion of the language then they do now. There's a world of difference between starting a new project in a language using newer features and libraries in that language and maintaining some monstrosity from a decade or more ago, which some of these people may have been caught up in. I'm a Perl developer myself, and when I have to work on 10-20 year old Perl code (or new projects where I feel we haven't adapted to all the newer things we could so we're forced into paradigms that are dated), it can feel very painful and disheartening, like you're standing in place and the world is moving around you. Too much bleeding edge is bad from a reliability standpoint, but too much stagnation is bad from a developer mindset standpoint. Both have their own business costs.
- hu3 6y agoYou'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.
- kbenson 6y agoYeah, it's actually a pretty good method to get a feel for people, in my mind. There's a lot of red flags it can expose. 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. :)
- eggsnbacon1 6y agoits 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?
- hu3 6y ago> From a distance Wordpress code looks like Nigerian Prince emails. And crazy coding conventions like mysql_real_escape_string. Really PHP This is good stuff. And correct. I'd love to hear that during an interview. Although mysql_real_escape_string() is not really used anymore nor condoned last I checked. > PHP sucks because of the dollar signs everywhere Now this is just an opinion. No bueno my friend.
- cafard 6y agoActually, what I dislike about PHP's dollar signs is that the make it look like Perl, but they are tacked on to lists and hashes also.
- Carpetsmoker 6y agoI suspect the dollar signs may be part of the reason of PHP's success. While it's clear for experienced programmers that "x" and "y" are variables and "foo" is a function in "x = foo(y)", for new programmers "$x = foo($y)" is probably easier to read and mentally parse. That is my personal experience anyway, as someone whose first truly serious language was PHP 20 years ago. Maybe it was just because I was used to it (BASIC also used $), but it took me a bit to get used to the "bare" variables in Python and C back in the day.
- aries1980 6y agomysql_real_escape_string() comes from the MySQL C library binding: https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-string.html https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-st...
- eggsnbacon1 6y agothis actually makes sense. Maybe I was wrong about PHP. But maybe not :)
- erik_seaberg 6y agoDid PHP ever decide whether NULL < -1 or NULL == 0? I want to hire people who care about correctness, and insanity like that really should bother them.
- xellisx 6y agonull == 0 is true. null === 0 is false. false == 0 is true. false === 0 is false. null == false is true. null === false is false. null < -1 is true.
- jraph 6y agoLike in JavaScript, just don't use ==. It's broken but you don't have to use it. In C you can write i[t] instead of t[i], but don't do it. I guess it's true for many languages. These funny features don't prevent you from writing good code, especially if you enforce some coding styles that will catch any unintended use of these features. Blame PHP for what you can't do with it, or for things you don't like but are forced to do. For instance I like PHP but I cannot type things the way I'd like. It's getting better though. I don't like the inconsistencies in the function names of the standard library but the functions are often straightforward and very simple to use. And, above all, the doc is good. These aspects mean I don't waste time figuring out how to do simple things because of a complex interface involving many classes, despite the inconsistencies. I also don't like the dollar notation for variables but that's a matter of taste, nor the syntax for namespaces, nor the implicit declaration of variables (like in Python by the way).
- SwiftyBug 6y ago> In C you can write i[t] instead of t[i], but don't do it. I had to check this myself. I'm astonished.
- ChrisSD 6y agoC array access syntax is just syntactic sugar for pointer arithmetic. The array decays to a pointer so `t[i]` is interpreted as: *(t + i) So you can see how swapping that around to `i[t]` is effectively the same operation: *(i + t)
- kemonocode 6y agoPHP has its pros and cons. A big pro is definitively job security: learn it now, learn it well and you'll have work for quite a long time. Composer is a pretty sane package manager, there are tons of frameworks and libraries out there to do nearly anything you can imagine, and also it's surprisingly fast. I'll even forgive the operator weirdness-- one big pain point that remains for me is how debugging PHP code is done. That said, after dealing with JavaScript and its inane ecosystem has made me appreciate all the ways in which PHP has improved over the years, although that's probably not the kind of answer you'd be looking for. :P
- hu3 6y agoIt's a sensible and valid answer that wouldn't raise any eyebrows on my part.