PHP vs ASP.NET
Have you ever talked to a NASCAR fan and asked him Chevy or Ford? Or a college football fan and asked Ohio State or Michigan? Or how loaded is the question, are you a Republican or a Democrat? It’s pretty funny how it’s really hard to find someone with an unbiased reaction to those questions. If YOU are asked one of those questions, you almost don’t even want to answer because there’s a 50/50 chance you’ll end up in some sort of endless argument. (Read about halfway down this article to see how loaded the question Pepsi or Coke? can be) The same holds true for computer geeks when you ask PHP or .NET? Programmers seem to either be gung-ho Open Source advocates or Micorosft worshipers.
Well, folks, the good people at Home Base Web Solutions are here to offer an unbiased overview of the two for your reading enjoyment. We do realize that if you are reading this article, you probably are thinking of programming your own website rather than paying us to do it for you and we are OK with that. If your site fails, give us a call and we will make it right.
First of all, before getting into specific pros vs cons of the PHP vs .NET, there are some important general concepts to understand:
- First and foremost, .NET is a framework, PHP is a language. .NET can be developed using many different languages, the most popular are C# and VB.
- .NET is proprietary, PHP is Open Source. Support IS available for both. Microsoft support may come from certified professionals, but sometimes costs money. PHP support is more readily available, but may come from forums with no guarantees.
- .NET may include compiled code (.dll’s), PHP is interpreted at run time. If designed properly, this should result in faster loading pages in .NET… however, unless you are doing some sort of very complex operations behind the scenes, the difference is negligible. There are probably specific examples out there where one method is faster than another, but there are many variables that go into how fast a page will load. If the page is designed well, it will load fast. A nanosecond either way won’t bring down anyone’s server.
Now below is a quick comparison of some general features comparing PHP vs .NET.
| Features | .NET | PHP |
| Easier and quicker to learn | X | |
| Faster to deploy on small websites | X | |
| Superior development environment | X | |
| Built in plumbing for a wide variety of functionality | X | |
| Designed to scale | X | |
| Loosely typed, easier to develop small applications | X | |
| Generally quicker to make simple changes to existing apps/sites | X | |
| Hosting costs are generally the same | X | X |
| Precompiled (.NET) vs. Interpreted at run time (PHP) | X | |
| More control over the entire HTTP pipeline using HttpModules and HttpHandlers | X | |
| Debugging and error handling capabilities | X | |
| Object Oriented framework: inheritance, polymorphism, overloading, etc. | X |
Now before we get a million comments about the quick run-down above, it is important to note that it IS possible to develop object oriented code using PHP and just because .NET has some neat debugging capabilities doesn’t mean that they’re always immediately easy to implement. There is plenty of material out there that argues tooth and nail either way, but in our general experience, we have found everything above to hold true… for us.
At Home Base we may use either .NET or PHP depending on the application. Small standard web applications such as blogs, brochure websites, standard shopping carts, and basic content management systems are done using pre-existing open source, PHP based solutions. WordPress, Joomla, and a host of shopping cart solutions are out there. They are easy to install and easy to customize. An entry level programmer can open up a PHP based website and probably figure out some of the nuts and bolts of the system to make some minor changes.
For large custom applications, our preference is to use .NET. The scalability, built in components, and inherent object oriented framework provide solid fundamentals for a well designed application. .NET also provides us a platform to more easily implement a multi-tiered framework, which allows us to use some development techniques such as test driven development, or the ability to plug in specialists into specific layers if ever necessary. .NET also opens the door for us to have multiple User Interface gateways. We could develop an application and interchange a web interface with a mobile interface with a desktop interface or even some custom robotic pimp shit interface that hasn’t been invented yet. If your application is properly layered, you can interchange all of those UI’s without touching your core. (I am currently developing an application for the Microsoft Surface. 90% of my development and testing will be using a simulator. This is all possible, and easy, with proper layering.) We will save the benefits of an N-Tier software architecture for another post though.
We also prefer MS SQL Server 2005/2008 vs MySQL, but again, that’s another post. You can technically use either database application for either PHP or .NET, but typically SQL Server comes hand in hand with .NET and the same holds true for MySQL with PHP. If your database is small (<100,000 records) and your server load isn’t at CNN levels, MySQL should work fine.
I will try to update this post with some good links to similar content.