What’s Wrong With PHP? Why Developers Hate It

PHP has been hated for decades, and whether it deserves it or not.

Muhammad Usman
7 min read5 days ago
Why Developers hate PHP?

What’s going on, guys? In this article, we’re going to talk about PHP and whether it sucks or not. And why developers hate It.

Now, stop right there. I know you’re about to click away because nobody cares about PHP, and you don’t either. But you should. Maybe. It might just be the most important thing you ever learn. No, probably not. But it is kind of important, and it’s worth spending a couple of minutes hearing what I’ve got to say about it.

The Hate for PHP

The Hate for PHP

PHP has been hated for decades. I mean, decades. I’ve been around a long time, and I can’t remember a time when somebody wasn’t complaining about PHP being absolutely terrible. But is it? That’s what we’re going to talk about in this article.

Why Does Everybody Hate PHP?

Why Does Everybody Hate PHP?

The fact of the matter is PHP is incredibly easy to use, and it’s very quick to use. There’s nothing to install, there’s nothing to configure. Every single cheap web hosting account out there has PHP already installed. And if you have a more expensive hosting solution like Heroku or AWS or whatever, it’s very easy to get PHP up and running on those as well.

If you’ve got a cheap web hosting account for like $10 a month — and let’s face it, unless you’ve got a website with hundreds of thousands of users, a $10-a-month hosting account is probably enough to get you started — if you’ve got one of those accounts, it has PHP on it. All you have to do is upload a file called index.php or whatever.php, type a little PHP code into there, and it will just work.

That’s opposed to every other web framework like Django, like Flask, like Ruby on Rails, like Node.js, where you have to learn two things: the programming language and the web framework. So you have to learn Python and Django, you have to learn Python and Flask, you have to learn Ruby and Ruby on Rails, you have to learn JavaScript and Node.js, and on.

With PHP, there is no framework to learn. Now, I know there are many PHP frameworks, and yes, you can use one. Because you don’t have to. It just works without it.

So that makes it incredibly easy to get up and running very quickly for small startups, individuals, people with not a lot of experience or coding skills. And that’s fantastic. But it’s also the reason why people hate PHP so much. And I’ll explain.

The Story of Billy and PHP

The Story of Billy and PHP

There’s a story that’s been going around for decades. I’ve heard it at least a dozen times in a dozen different ways, and I’m going to tell you the story today.

The Beginning

There’s a company. They hire an intern named Billy. And Billy’s sitting around without much to do because he’s an intern, and the company doesn’t really know what to do with him. So he’s just kind of watching.

Over the days, he notices that the company has a really weird inventory system. It’s mostly just a half dozen to a dozen Excel spreadsheets scattered all over the place. And anytime somebody wants to do anything with inventory, they need to pull up a specific spreadsheet, fill it out. It’s a hassle. Then at the end of the month, two or three people have to compile these spreadsheets and create all these reports. It takes two or three days every month just to do it, and it’s a mess.

Billy thinks, why don’t they have a centralized database for this and some little web interface to take care of all this stuff for them? So he starts to build it.

Billy’s PHP Solution

Billy’s PHP Solution

Now, Billy doesn’t know what he’s doing. He’s not really a coder. But he’s watched a few PHP videos, and he knows enough to be dangerous. So he starts building this thing out — little database, little web interface, starts punching all this stuff together, creates a couple of reports where you press a button at the end of the month, and it does its stuff internally and spits out the report. It looks pretty good.

So he shows it to his boss, and his boss is ecstatic.

“This is great! We’ve been needing this for years! Thank you so much, Billy! But can you add this, this, and this report as well?”

Billy says, “No problem.”

Pulls up his code. His code’s four or five pages. It’s not bad. It’s kind of messy, it’s not really indented correctly because he doesn’t know what he’s doing, it’s all single-spaced, it’s a little hard to read, there are no comments at all. But Billy can read it because he just wrote it.

So he starts to modify it. He starts to add this, this, and this report. Shows it to the boss.

“Fantastic! Thank you, Billy. That’s great!”

The Growth and the Problem

The PHPGrowth and the Problem

A couple of months go by, and they use this thing, and it works fine. But then somebody else says, “You know what? We really need this and this report. And while you’re at it, this other report too.”

Billy says, “No problem.”

He starts coding. His code turns from five or six pages to nine or ten pages. But it’s fine. He knows what he’s doing.

Another department hears about it. They say, “Hey, can we get in on this action?”

Billy says, “No problem.”

Now his code’s like 20, 25, maybe 30 pages. It’s getting harder to read.

Another couple of weeks go by, they ask for a few more reports to be added. Suddenly, it’s 40 or 50 pages of code.

Billy Moves On

Billy Moves On

Billy realizes he did a pretty good job. His bosses are thrilled. He puts it on his resume. In 30 seconds, he gets a half dozen job offers from other companies for double or even triple what he’s making as an intern.

Billy takes off.

A year goes by. The company hears from their manufacturer:

“We’re updating our inventory codes. Just letting you know.”

Company freaks out.

“Uh oh, Billy’s system isn’t gonna work with all these new codes. We need to update it. Bob, you’re our senior programmer, have at it.”

Bob opens Billy’s code. It’s 40 pages. No comments. He throws up a little bit inside.

Bob shakes his head and goes, “PHP…”

Does PHP Suck?

Does PHP Suck?

Bob thinks so. And all the other real programmers out there think so. Because they get code from people who don’t really know what they’re doing.

But PHP is just a tool. Like a hammer. If you hit someone over the head with a hammer, you’re an idiot. It’s not the hammer’s fault.

Conclusion: PHP Still Has Its Place

There is no doubt Python is a better programming language. Ruby is better. Even JavaScript is probably better. But PHP is still decent. If you’ve got an idea and want to crank something out with PHP over a weekend, you can.

Don’t just discount PHP because you heard someone say it sucks. It’s probably Bob. That’s all for this article. I’ll write you the next article. And PHP isn’t that bad.

Thanks for reading to the end — you’re awesome! 🙌

Let’s grow, learn, and build amazing things together! 🚀

If you found this helpful, don’t forget to clap 👏, save it, and follow me for more insights.

Let’s stay connected!
📍 Find me on: LinkedIn | dev.to| Bluesky

--

--

Muhammad Usman
Muhammad Usman

Written by Muhammad Usman

Full-Cycle Web Strategist & WordPress Developer | Expert in Custom Builds, Technical SEO, and Data-Driven Web Solutions. My passion is to write on everything 🚀

Responses (6)