Why do people choose to start a project with PHP? Ever.

I got into a discussion with a co-worker (and PHP programmer) about the PHP language and why a new project would ever be started using it over other popular languages. He happened to be on his way out from our company and was starting at a new development company where they programmed, near exclusively, in PHP.

Disclaimer

My exposure to PHP has typically been a forced one. I never actively sought to learn the language, but I’ve had to develop in it on numerous occasions and I can get the basics done with relative ease. I don’t claim to be a PHP programmer and I would call myself a novice at best when it comes to writing code in the language. I am a C# developer by trade.

To me, PHP does not seem to be a good choice for starting new projects that you plan on being successful. Every time I’ve seen a large PHP application, it just looked like a complete mess that nobody but the most familiar with the application could comprehend. The language was not designed to be object oriented (assuming you feel that OO is a huge step forward like I do), and they are just pushing some essential functionality to the language in the upcoming release of PHP 5.

PHP has always seemed like more of a client side language to me, probably because it’s basically a scripting language. It reminds me of classic ASP which I don’t care to be reminded of.

It has the following perceived problems in my eyes:

  • It’s feature set seems crippled in comparison to other languages.
  • It seems to take more code to accomplish the same task as other languages.
  • You need to use 3rd party frameworks to get acceptable performance and scaling, let alone to get needed functionality.
  • There is no good IDE for it that I have found.
  • Most modules are not thread safe.
  • There are no namespaces (yet)
  • Configuring PHP can be a major pain in the ass, especially on Windows IIS.
  • Session handling sucks.
  • Object Oriented development is difficult, even with the new features. It just seems crammed in there.

  I If you were going to create any type of serious program for the web, wouldn’t it make more sense to use a more robust language like Java or a .NET language?  Yet, very large, very successful web applications are built on PHP (Wikipedia, Digg, Facebook, the list goes on…). New and innovative web applications are constantly being developed in PHP. Entire web development companies code in nothing but PHP! WHY!?

Reasons for using PHP?

Is it because there is less overhead with the code? I admit that I use .NET along with its AJAX.NET additions to write applications on a regular basis, and it sure does add a lot of unneeded overhead (not to mention ViewState). But it lets me write code so much faster by having access to the added functionality when I need it.

Is it because it’s free? I’ve heard that argument as a major selling point over and over again, yet just about every PHP developer I’ve met programs on Windows or a Mac. Besides, Java is free, the .NET language is free, and so are its (express) development tools. True, to avoid headaches you need a Windows server to deploy .NET applications to, but Java will run on that same LAMP server, just toss TomCat on it.

Is it because it’s easy to learn? Maybe. I would have to say that it’s got a flatter learning curve than the other languages and may be more inviting to the newbie.

One thing is for certain, PHP development isn’t going on in the enterprise, and for good reason.

A plea for help

Can someone tell me WHY you would start a new application in PHP? What are the benefits? If you knew PHP equally as well as Java or a .NET language, why would you code in PHP?

kick it on DotNetKicks.com


Related posts

Comments

August 21. 2008 03:35 PM

Korayem

I always have the same question. I sat down with a php guru friend of mine and was surprised to find that php's roadmap was to reach what java and .net are now (OOP,compiled language..etc)

So why guys do you use a language which it's ultimate goal is reaching what others are at right NOW!?

Korayem

October 6. 2008 05:16 PM

'nonymous

Not sure why they're heading towards ASP.NET and Java.... Both ASP.NET and J2EE are in utter shambles from poor architecture choices, over-engineering, and terrible overhead.

I'd say the only smart choices lie with Python or Ruby right now... Web is different that desktop apps... you *must* have a dynamic language to make things simple enough....

I'm an ASP.NET expert, and a J2EE wannabe. Which is why I'm anonymous... I don't want to badmouth my source of income publicly Smile

'nonymous

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

November 20. 2008 04:14 AM

Search

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008