nav-left cat-right
cat-right

Defend PHP

I ran across a great discussion at StackOverflow today that started with this question:

I made a tongue-in-cheek comment in another question thread calling PHP a terrible language and it got down-voted like crazy. Apparently there are lots of people here who love PHP.

So I'm genuinely curious. What am I missing? Why makes PHP a good language?

The article lists a dozen or so "flaws" with the language, and then continues:

Worst of all, PHP convinces people that designing web applications is easy. And it does indeed make much of the effort involved much easier. But the fact is, designing a web application that is both secure and efficient is a very difficult task.

By convincing so many to take up programming, PHP has taught an entire subgroup of programmers bad habits and bad design. It's given them access to capabilities that they lack the understanding to use safely. This has led to PHP's reputation as being insecure.

Are the flaws in PHP really any different from any other language?

I'm a C# programmer, and I have to disagree with what some of what the original poster asserted were flaws with PHP.  Overly broad implicit type conversions?  Too easy to couple presentation with logic?  Heck, those are the reasons it's so popular in the first place!  Making web programming easy is a flaw?  Wut?

After wrestling with the back and forth in that discussion, I came to a simple conclusion.    This person has fallaciously concluded that PHP is a bad language based on his perception of its compliance with ivory-tower, computer science academia concepts.   Most of his criteria could basically describe Perl, Javascript, VBScript, heck, even VB6, HTML and C.

Of course PHP isn't a horrible language.  It's simply a tool, and based on its wild popularity and simple learning curve, only a fool could conclude that it was a bad one.  Even if it breeds more "unsafe programmers" (which I doubt highly), it's simply not the language's responsibility to restrict what you can do just because you might do it.

Every programmer should be able to see that.

Be Sociable, Share!

4 Responses to “Defend PHP”

  1. blake says:

    There are definitely some terrible assumptions there. One of my favourite might be "By convincing so many to take up programming…" I would love to meet the person that said to themselves "Wow, PHP looks so easy, I'm going to become a programmer."

  2. Paul says:

    Open source, thanks.

  3. Daniel says:

    I am a Java programmer. For personal purposes worked a lot in .net and php.

    I remember the time when I thought will never touch php because of various reasons (scripting sucks, not reliable, defects, stuff like that). Right now I have at least four midsize projects finished in php who work perfect and although for big stuff I still prefer Java or .net, I am very happy I know php.

    I remember the time when I believed .net will push Java off the market. I put a lot of effort in learning .net and never regretted, but still Java is alive and well.

    And at last, I remember when I considered that for web for example, some technologies ALWAYS offer a better time to market then others. That's not true. There are differences but not notable. Other things must be considered when choosing a technology, and time to market is far from being the first one on the list.

    Conclusion: will never say a technology is bad and will try to always remain open minded.

    Thanks for the posting.

  4. Aschwin says:

    People who make such assumptions probably think COBOL or MUMPS are the way to program. And hey, these languages are still out there even though there are alternatives. But organisations just started using a language (or better, their employees did) and they sometimes just can't get rid of it because of mayor impact risks.

    For PHP, it's just like with the chicken and egg: would PHP be popular because of the ease of use or did it became a good tool to use because of the popularity (wide spread)? I think PHP grew with the Internet, while JAVA and other languages existed before and grew in maturity as well. PHP is quite 'young' in that perspective.

Leave a Reply