Commentary: Why Do People Hate PHP?
|June 1, 2012||Posted by Greg Bulmash under PHP|
I recently read Kevin Schroeder's blog post about 10 Reasons To Use PHP. Then -- silly me -- I started reading the comments. It only took a few before the obligatory anti-PHP hater came out and started insulting the language and the people who use it. That made me think about why that hate exists.
People Fear What They Don't Understand
I think you can say the same things about PHP. It's very easy for someone who isn't serious about programming to pick up enough information to throw together some scripts. I think that's what attracted me to it. PHP was free and I was able to pick up everything from a basic "Hello World" to querying a database in the space of a weekend.
PHP != Permissive Half-assed Parenting... Sort Of
To some people there is a right way to program and a wrong way to program. Because PHP is dynamically typed, usually has multiple ways to skin a cat, and tends to be forgiving of kludgy hacks, you can get away with a lot of code that makes formally educated coders cringe. And any language that lets you do cringeworthy stuff has to be bad, right?
They think it's not a good thing that someone can write really crappy PHP code and have it work. That kind of positive reinforcement is only going to lead to more bad code.
There is some validity to that criticism. I remember a teacher complaining many moons ago about students steeped in writing spaghetti code by BASIC, and that he had to spend way too much time breaking them of bad habits. Starting with a programming language that enforces and reinforces good habits can be a way to prevent people from learning bad habits they'll have to unlearn later if they want to be "serious" programmers.
The alternative argument, though, is that permissiveness makes it easier and more inviting for people to get started. It lowers the barriers to entry, not only in terms of price, but effort. People can dabble and experiment more easily. Honestly, if I had to start with Assembler instead of BASIC, I think I would have given up on computers before I got addicted.
The Exclusive Fraternity?
Sometimes I think it's because PHP lets people like me get jobs as developers.
I'm going to let you in on a secret. I didn't take a single math or computer class in college. I took an advanced course back in high school that earned me a college credit in Computer Science. When I finally got around to getting my degree in Creative Writing nearly a decade later, that credit was considered a valid substitute for my university's mathematics requirement.
I short circuited the traditional steeping in logic and math that real "engineers" go through. I just learned to program... on my own... from books and web sites... picking it up in bits and pieces as I have gone along. I'm a tradesman, not a craftsman, but my job title and certification claim I'm a software engineer.
Sometimes I think it drives "real" engineers nuts. And I feel for them. Remember, I got my degree in Creative Writing. They must feel how I felt when I found out Snooki had a book deal.
You Are Either With Me Or Against Me
Person 1: Macs rule! Windows sucks!
Person 2: Compile Linux from source and then you'll have a real OS, dumbass!
Person 3: Mitt Romney belongs to a cult!
Some people can't simply be happy with their choice. They have to insult the choices of others.
Let Me Sum Up
Everyone has reasons why they prefer one language over another. That's okay. Please don't interpret anything I said above as implying it's not okay to have a preference or that it's not okay to prefer something else to PHP. I'm just talking about the people who feel the need to talk smack about PHP and those who develop in it.
Usually someone hating on PHP does so because they don't understand it, are upset by what it lets people get away with, feel it makes it too easy for someone to earn the title of "developer," or because they're dicks who have to insult other people because they can't simply be happy with their own choices.