Tuesday, 1 March 2011

PHP vs ASP.net : An Easy Comparison

What is the big difference between ASP.net and PHP?, PHP is so much quicker and it's free, why choose ASP.net? or Why can't an ASP.net application just be as easy as it's PHP counterpart. These are just a few of the questions you ask yourself when trying to choose a web platform/programming language to start your new project in. Both languages have pro's and cons, and both have their special areas where they excel at. 
Of the two, PHP is much cheaper. To get started in ASP.net you require IIS, Windows Server, and an IDE such as Visual Studio. While all of these have free options in their "Express" versions, if you are doing any enterprise level development, you will eventually require the full versions which are nothing short of ridiculously expensive. PHP on the other hand is completely free to get started, all the way down to the operating system (Linux).

However while PHP IDE's are free, they often require alot of tweaking and addons to get anything near the level that Visual Studio brings. Often these plugins will cost and it can all quickly add up. However it is still not near the cost of Visual Studio.

Out of the box, PHP does not come with any templating system. However you can use the "include" function to include portions of your template in your code, but this does not compare to the powerful "Masterpage" system in ASP.net. PHP does however have several free open source templating systems that bring it up to speed with ASP.net, however they can be a bit jerky to get configured.

Both systems have the ability to develop in the MVC model. However only ASP.net's comes with it direct from Microsoft. PHP you are once again relying on third parties to supply the development environment.

Many developers simply choose whichever platform they were first exposed to (For better of worse). However when it comes to Web Development, you need to choose which ever feels right for the job, not the ones you are a fan of.