Live data from Hacker News

Why Developers Hate PHP

jesuisundev.com

41–50 of 114 posts

Re: Why Developers Hate PHP

#41
post #4

Here to see how many comments don't bother reading the piece and just react to the title.

I didn't, skimmed. > PHP is the most widely used language in the world for websites. Being served does not equate to being used to develop new things. Is there really that many new websites, website features being authored in PHP? Sure there is maintenance work and some popular platforms are written in it. But beyond that? I haven't seen a job posting in long time.

My company has switched to using it. The 7.x versions have really made PHP a much better experience. I still hate the inconsistent method names.

Re: Why Developers Hate PHP

#42

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ is a classic of this genre.

pick a random language, ruby, python, javascript etc etc and you'll find similar rants/complaints. Yet I think right now it's cool to shoot on PHP therefore everyone is more vocal

Yet I think right now it's cool to shoot on PHP

This is not a recent thing, it has always been cool to mock PHP. It's not entirely unwarranted, but most programming languages have their own warts.

For example, for some reason, creators of dynamic languages think they need to mess with variable declaration, to make it more accessible, or whatever, instead of staying with tried and true lexcially-scoped block-level variables with explicit declaration. As far as I can tell, the result always ends up worse.

Re: Why Developers Hate PHP

#43

That "article" spent half its time leading up to explaining why PHP is bad and half its height on GIANT MEMES. The actual content was half a paragraph about how PHP lacks strong conformity... needless waste of bits

Agreed, the author might have a good point but I really dislike this style of writing where I have to scroll through a few megabytes of animated image macros to get to the point.

These memes are always forced and never funny.

Re: Why Developers Hate PHP

#44
post #33
post #17

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

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

It'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.

Re: Why Developers Hate PHP

#45
post #10

I "hate" my experiences in the aughts debugging other peoples PHP code, which put me off. But I primarily use JS now, and I feel like it's just as hated (but maybe more loved?). But I can't imagine how much people would hate JS if node came out in 2001, could you even?

I wonder what people would think of Node if it came out right before the tech bubble burst and the company hosting all the package repositories sank without a trace, taking the packages with it. That would have done some lasting damage to the web development world.

Re: Why Developers Hate PHP

#46
post #6

I couldn't find a date on this article, but I don't think this line is accurate anymore: "Facebook, Wikipedia, Yahoo, Flickr, Tumblr all these sites run in PHP and welcome millions of users every month without flinching." Facebook dropped PHP for their own language called Hack, which I think is based on PHP but with a lot of the things people complain about changed.

I don't mind PHP (like I don't mind lots of things that I don't really have to deal with), but Hack is by far my favorite web language. It has most of what's nice about PHP (specifically, reload and your changes are there, memory is request-scoped, etc.), without most of what's awful (the HSL fixes most of the goofy inconsistencies, real (although still not as expressive as I'd like it to be) static typing, etc.).

Re: Why Developers Hate PHP

#47
post #17

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

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 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.

Re: Why Developers Hate PHP

#48
post #38

I 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

Found the non-Perl programmer (the sigils for scalars, arrays and hashes are $, @ and %).

Re: Why Developers Hate PHP

#49

I will say this for PHP: Its interaction with my brain had such a nearly-disastrous impact on my life, that it finally allowed me to finally get the mental health treatment I'd been seeking for a decade, and to realize the fundamental and unfixable weakness of my marriage. ------------------------------------------------------- If you enjoy eating pad Thai, that is great for you. I do too. But different people are di…

There's an obvious difference between choosing not to use PHP and shitting on an entire language based on a decade's old idea of the language is.

Re: Why Developers Hate PHP

#50
post #3

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

What was the point in this comment? You basically just complained about a bunch of random stuff. I can assure you that you're way more bent up about this than any PHP dev would be from reading this comment.
Post reply on HN