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'm not going to accuse these haters of being ignorant in general or even ignorant about programming. For the longest time, before I had to use JavaScript for more than some simple form validation and DHTML effects, I thought JavaScript was just a low end set of tricks, not a real language. Someone pointed out to me that one of the reasons JavaScript got no respect was because it had such a low barrier to entry and such an easy to learn set of basics, it was perceived as a language anyone could just "pick up." And if it was so easy to pick up, there couldn't be much skill involved.
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.
But with both PHP and JavaScript, the more seriously I started using them, the more serious I realized they were. It's only when you start trying to solve complex problems with them that you realize that they have the complexity and power under the surface to step up to the task. Some haters simply mistake PHP's simplicity for being simplistic, because they don't understand PHP, and thus they think those who like it are deluded.
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.
Good article. I have been programming for 30 years and have seem my share of haters anf spagetti cofe writers in every langauge.
The best asset of PHP is the low cost of entry but also easy to move
Into a highly structured framrwork. A bonus is this that i can all my prpgramming with a simple text editor.
In case my original post gets redacted (not unlikely,) I'll summarize:
Because the architecture and "design" of PHP is provably bad.
It probably got auto-rejected for too many links. One of the anti-spam rules WordPress lets you set is "no more than 3 links".
As for stuff like the "fractal of bad design," reading it just made me think of all the criticisms people heap against English. Predictability, consistency, etc. On the other hand, while written English has some craziness, spoken English is simpler than many other languages.
I could make the claim that any language that modifies adjectives as if tables have vaginas or needs 6 words to say "went" is "provably bad," but I don't go around trolling sites where people speak in or discuss Spanish to tell them what a piece of crap their language is, because for its flaws, it's produced some awesome literature, poetry, and philosophy. Like PHP, Spanish can be used to make amazing stuff, as can English. They all have things we wish they'd do differently, but they don't, we adapt, and the best of us create magic with them.
PHP was created for amateurs.
It is not elitism to look down on the amateur-hour nature of PHP and ALL of its fanboys.
Calling it elitism just reflects your feelings of inadequacy because you are a self-trained PHP user that thinks computers are magic
amateurs, and what do you program your websites in? cobolt?
imbecile