“What’s the difference between PHP and ASP.net?”, “Why can’t PHP Applications talk to ASP.net applications?” or “That could have been done in PHP so much quicker, and for free”. These are some of the questions you will face when trying to decide on which web platform to use; ASP.net or PHP. Both platforms have their pro’s and equally, both have cons.
PHP is the “cheaper” of the two platforms. Infact, to get started in PHP is absolutely free to get started including operating system, web servers, and a development IDE. When you compare that to the starting cost of ASP.net: Visual Studio, IIS, Microsoft Server. It can all quickly add up. Microsoft have given out “express” versions of most of their software to get started, but you the costs will eventually come if you are working on an enterprise level.
While PHP IDE’s are free, they often require lots of addons and plugins to get to the level that Visual Studio provides. Often these plugins will cost, (Albeit not as much as a full package of Visual Studio) which can quickly add up.
Depending on who you ask, PHP’s loosely typed structure can either be a blessing or your worst nightmare. While the ability to convert between variable types without any special parsing makes coding easy to begin with. It often creates issues at runtime when a function can return both a boolean or an int. ASP.net is mostly strongly typed, although in.net 3.5, the “var” keyword was introduced to allow for ambiguous variable types. The strongly typed nature gives it a much more structured approach, where you will always know what a variable will contain.
Out of the box, PHP doesn’t come with any templating system. While you can simply “include” portions of your template, it isn’t as powerful as ASP’s built in “MasterPages”. You can use templating systems for PHP from third parties, but it is yet another “addon” that you will be required to get.
While both systems have the ability to use the MVC model, ASP.net has an “official” addon which comes directly from Microsoft. PHP’s most popular MVC implementation is CakePHP which is free to download.
There are many factors that may sway you each way. Many developers will simply choose whichever platform they were first exposed to (for better or worse). My advice is to simply choose PHP for more loosely put together web scripts, something that requires more flexibility and less overhead. Use ASP.net (with MVC), to create stable enterprise applications.