About the Author

Chris Shiflett

Hi, I’m Chris: entrepreneur, community leader, husband, and father. I live and work in Boulder, CO.


Six Reasons PHP Sucks

Theo has posted the slides of his PHP lightning talk in PDF format. The topic? Why PHP sucks.

I've never disputed the fact that PHP has problems, but for some reason, everyone who tries to explain why PHP sucks misses most of the actual reasons it does. It's astonishing.

Theo doesn't give six reasons I agree with (one or two are there for comic relief), but he starts off with three solid points. More importantly, he notes that Java sucks more, but he can't cover that in five minutes. :-)

About this post

Six Reasons PHP Sucks was posted on Thu, 03 Aug 2006. If you liked it, follow me on Twitter or share:

27 comments

1.Travis said:

Chris,

The link (http://omniti.com/~jesus/misc/PHP%20Sucks.swf) is throwing a 404...

Thu, 03 Aug 2006 at 18:55:19 GMT Link


2.Chris Shiflett said:

Thanks, Travis. I'm bugging Theo now. :-)

(It worked earlier.)

Thu, 03 Aug 2006 at 18:56:40 GMT Link


3.jordi said:

One of the most annoying things in PHP is PHP's fastCgi support.

besides fcgi support i don't have any other complain

Thu, 03 Aug 2006 at 19:07:32 GMT Link


4.Chris Shiflett said:

The link has been fixed.

Thu, 03 Aug 2006 at 19:19:48 GMT Link


5.Tim said:

I completely agree with lexically scoped variables and namespaces. Seriously. We need those.

My number 1 reason that I wouldn't use PHP (or perl) in a heavy load environment is the lack of database connection pooling. 1 connection per Apache thread? That's insane. That's the one place Java will always beat PHP (or perl).

Thu, 03 Aug 2006 at 21:53:46 GMT Link


6.Terry Chay said:

http://terrychay.com/blog/article/php-sucks.shtml

Fri, 04 Aug 2006 at 00:36:35 GMT Link


7.Luke Welling said:

It must be "We Love Java Week".

Is it celebrated at the same time every year?

Fri, 04 Aug 2006 at 10:43:03 GMT Link


8.Jack said:

last reason:

Java sucks more, but he can't cover that in five minutes.

can be rewriten:

Flash sucks even more and more and you could cover that in fist minute you start it!

Fri, 04 Aug 2006 at 13:48:37 GMT Link


9.Mutant said:

This reads like a 5 year old. Has he ever considered making a cogent point with anything resembling intellect?

Fri, 04 Aug 2006 at 14:36:06 GMT Link


10.Ed Finkler said:

I enjoyed Theo's talk a lot, but I did think the shot at PEAR was beyond exaggeration for humor's sake and into the realm of unfounded criticism. The PEAR code I've used -- and I don't use a ton, but what I do use I use a *lot* -- seems pretty good to me, and certainly far above the level of stuff at phpclasses.org or the user-contributed notes in the php.net docs.

Fri, 04 Aug 2006 at 15:08:38 GMT Link


11.Terry Chay said:

Luke, I thought it is separated any week of the year you’re not actually trying to get any work done.

Mutant, The idea is to be able to laugh at the deficiencies in your own language.

I wonder if it were PHP5 weren’t out and I said that PHP objects were the most braindead implementation I had ever seen if I’d have been considered over-the-top?

So it is with issues like namespacing, the horrible code examples in the PHP documentation, and the politics that often decided what PEAR library gets in…

Ed, think of it this way, in CPAN almost anyone can put anything in there is code of a lot of variety. In PEAR, only the “good stuff” is supposed to get in (because of no namespacing), and then you look at it. Sure it beats a lot of code snippets you see out there, but then you look at it and say, “This is the good stuff???”

A shiver passes down your spine as you realize that there must be some pretty bad “bad stuff” out there to warrant this library passing the crazy crap politics that is PEAR.

Fri, 04 Aug 2006 at 19:59:58 GMT Link


12.Ed Finkler said:

"A shiver passes down your spine as you realize that there must be some pretty bad “bad stuff” out there to warrant this library passing the crazy crap politics that is PEAR."

Shit, you know that, though. This is PHP: the power to heal, the power to kill, in the hands of a dork.

But I stand by my statement that there are some very well-done libraries in PEAR, and for quite a while it was the first and best place to look for solid components to build your web apps on. That situation has changed quite a bit in the past 2-3 years, though, but it's not like PEAR is suddenly a turd floating in the bowl of PHP development.

Fri, 04 Aug 2006 at 20:19:41 GMT Link


13.Ben Ramsey said:

"but it's not like PEAR is suddenly a turd floating in the bowl of PHP development"

What an awesome simile!

Fri, 04 Aug 2006 at 20:44:22 GMT Link


14.Luke Welling said:

I feel like I should defend the user comments in the manual too. They might have passed their prime somewhat, but once upon a time, the PHP docs had more gaps, did not tell you what version a function was added in, and did not mention that a function was completely broken on some versions. Back then, the user comments were invaluable.

The quality of the official docs is now much better, so I am sure that they are less valuable, but I imagine if you went into some of the fringe libraries, the comments might be as useful as the official text sometimes.

Of course, like any free for all systems, it is basically a big vat of floating turds and it is up to you to pluck the goldfish out from between them.

Sat, 05 Aug 2006 at 00:32:45 GMT Link


15.Aaron Wormus said:

User comments are user comments :) anyone who takes them seriously has issues. I always scan over them when looking at the documentation and often find interesting snippets.

A lot of crap in the mysql comments as well, but they really add a lot there as well.

Tue, 08 Aug 2006 at 17:16:30 GMT Link


16.Chris Shiflett said:

Yeah, I think the user comments have value as well. That's one of the points where I disagree with Theo, but it was nice to see someone voicing a few legitimate complaints.

Theo's talk was given with the same sort of humor and style as Rich's from a few ApacheCons ago:

http://people.apache.org/~rbowen/pr...hate_apache.pdf

Tue, 08 Aug 2006 at 17:30:30 GMT Link


17.Chris Shiflett said:

Andy Lester has a great explanation of why CPAN thrives:

"CPAN thrives because of the unfettered uploading of shit, not in spite of it."

(http://use.perl.org/~petdance/journal/29837)

I think there are plenty of good things to say about PEAR, but far too many people mention the word politics when talking about getting a package accepted. Why is this?

Perhaps it's just the cool thing to say, but there must be some truth to it. Would it ruin PEAR to allow "unfettered uploading of shit" instead of trying to maintain strict standards? CPAN has shown us that people tend to use the good stuff anyway.

Just a thought.

Tue, 08 Aug 2006 at 17:41:05 GMT Link


18.Aaron Wormus said:

(I hate to say this but...) The difference is that Rich's issues is that they are issues which come "from the trenches". Rich spends a LOT of time in IRC, he's help us all out, I have his book on my shelf, and he is very well known for his effort in supporting the Apache community.

What has Theo done to help PEAR or bring the quality level of PHP manual comments up? There's a difference in being self-deprecating and trashing something that others work hard on.

Wed, 09 Aug 2006 at 13:28:43 GMT Link


19.Terry Chay said:

Chris, I believe the restriction on PEAR (the politics) comes from the lack of namespacing in PHP. This means that it should be important to revisit the problem after PHP6.

The idea is the lack of namespacing, like with any large PHP installation, is going to cause conflicts because the only thing keeping your libraries sane is a naming convention that you tightly control. This is one of the major weaknesses of a scopeless paradigm of PHP (which caused the lack of namespacing).

In any case, Greg Beaver and others found a great way around some of this crap. The addition of channel subscriptions. It solves the problem of the politics, but makes PEAR very fragmented (at least if your stuff is languishing in an obscure channel somewhere).

It may seem like Theo’s rant is “trashing” but it really isn’t. These were honest design decisions that led PHP in a different direction than other languages. I think we have only to point to PHP’s huge marketshare to know that in many ways, these design decisions were good (or at least, not terribly bad).

User comments, the PEAR library, lack of namespacing, lack of lexical scoping. These are all the strength of PHP.

But sometimes it is fun to poke at when they can be a weakness.

Fri, 11 Aug 2006 at 17:29:01 GMT Link


20.James Benson said:

What a load of crap. I see their is no mention of Inconsistant function names, this is definitely my worst complaint about PHP, other than that it does exactly what it says on the tin.

Fri, 11 Aug 2006 at 20:23:37 GMT Link


21.Chris Shiflett said:

I don't see inconsistent function names as a problem. It's like criticizing a professional athlete for having an ugly nose.

George comments a bit on this in his recent interview:

http://devzone.zend.com/node/view/id/799

Fri, 11 Aug 2006 at 20:26:33 GMT Link


22.James Benson said:

Your right it probably aint a problem for people who know PHP and have been using it day to day but for new comers to the language I would say it is a major problem, I remember having this problem myself when beginning.

Wed, 16 Aug 2006 at 11:09:35 GMT Link


23.web programmer said:

who needs a rational language design when it comes to working on the web?

Coming from Java and dotNet, I embraced PHP's non-language flat style and actually started getting stuff accomplished.

All you need to do on the web is there in the flat library of functions and hashtables, and the superglobals.

Anybody who tells you you need a rationalized overengineered computing language to do this stuff should be programming guidance systems for lunar rovers instead of putting up a web site.

I am not missing lexical scoping and never use objects except when the utilities force me to.

Mon, 21 Aug 2006 at 14:12:38 GMT Link


24.joe said:

Was there a famous quote something along the lines of:

"There is software that people bitch about, and software that no one uses." ?

Another mild irritant is the mandatory "$this->" but there could be (inelegant but) handy workarounds.

My 2 cents.

Wed, 23 Aug 2006 at 14:11:37 GMT Link


25.Alan said:

How about the fact that I have to hit shift 2x to access an object property? RSI, people.

Wed, 19 Sep 2007 at 03:26:55 GMT Link


26.Adi said:

Chris,

This php sucks debate is actually getting annoying. The issue is most of these articles come from non php programmer usually java programmers.

some reason are absolutely wild like magic quotes, which can easily be turned off and its a nice feature to have in many places.

We work on php/java/ruby and c#/asp.net in my firm and most times when we have to use php, php is the only option everything else sucks.

The fact is the strength of any language is also is weakness. PHP is easy and less restrictive and so it has such a huge community, but that also attracts bad programmers and bad code which is targeted by these php sucks articles.

Php rocks for its purpose

Adi

<a href="www.appliedeye.com" title="">Appliedeye.com</a>

Sat, 02 Aug 2008 at 07:37:02 GMT Link


27.Yaroukh said:

Once I was obsessed with PHP. When 5 came out I was in heaven, "finally we have objects!"... I repeated the mantra "programmer matter, languge doesn't" too, also "you can write clean in PHP if you know how to". :)

After couple of years with Java it creates kinda sad smile to my face when I recall those times. It brings lots of pain and desperation each time I have to return to PHP. :(

Sat, 07 Feb 2009 at 11:48:13 GMT Link


Hello! What’s your name?

Want to comment? Please connect with Twitter to join the discussion.