PHP or ASP.NET?
The other day a friend of mine was telling me he was going to start a new project. He wanted to develop a new web app from scratch, and was telling me he was going to use PHP. He did have experience with ASP.NET from some other projects, so I told him to use this technology. But he still preferred PHP. The reasons he gave me were:
- PHP is free. You do not have to pay to use it. With ASP.NET you need to pay a whole bunch of licenses.
- PHP runs faster than ASP.NET.
- PHP hosting is cheaper.
- Out there on the internet, you can see more PHP than ASP.NET applications.
- There’s more CMS on PHP than on ASP.NET.
Ok, he had his reasons, but I didn’t fully agree with him. So I discussed some of those ideas with him:
- Yes, PHP is free, like ASP.NET. Well, at least for basic stuff. I mean, the core of ASP.NET is standardized, which means that anyone can develop a compiler/server for these specifications. As a matter of fact, the Mono Project aims to develop alternative components to replace Microsoft’s products. So far, they have released an implementation of the .NET runtime, a .NET development environment, and much more stuff. You can read more about this on Mono FAQ.
Besides, if you don’t like MonoDevelop, you can still use the free version of Microsoft’s Visual Studio: Visual Web Developer. It’s pretty much the same thing, only designed to be used just by one person coding by himself. - PHP is an interpreted script, while ASP.NET applications are compiled. This means that ASP.NET is way faster than PHP. Yes, you could still use some techniques to accelerate PHP (like caching), but those same techniques can be applied to ASP.NET as well, making it even faster. If you want facts, you can take a look at this comparison.
- Well, it depends. If you’re talking about installing your application in your own server, then you might need to install some windows server and IIS, and both of them cost money. Actually, Windows does cost money, but IIS is already included in the most recent versions. But, as I said before, the Mono Project provides some free alternative to that.
If you’re talking about deploying your web app in some external hosting and paying a monthly fee, then it is not more expensive at all. I’ve found similar offers in both technologies… it’s not even hard to find free external hosting for both platforms – although that might not be the best experience, depending on your needs. - So? Other people might have some other different reasons. Or maybe they want to adopt the cheapest platform and they just don’t know that ASP.NET is standardized and that there’s open source solutions for this technology as well.
- He might be right, the number of CMS implemented with PHP might be greater than those that use ASP.NET. But that doesn’t mean they’re better. In order to choose a CMS for your project, you should compare some of them and decide which one better fits your needs. And you can find almost identical functionality on CMS from both platforms.
But I still had some more points to add:
- Although many of them are not free, there’s a bunch of pre-programmed controls and components you can incorporate in your web app in ASP.NET (some of them are really impressive). And many of them don’t require much effort from your part… just drag&drop the component on your web app and you’re done. You can even develop your own highly-complex, highly-reusable web app controls and share them among many different apps in just a matter of minutes. This is especially useful for GUI widgets.
- By having full access to the .NET Framework, your ASP.NET application can have all the power of any Windows app.
- PHP is a single threaded application, while .NET framework supports multi-threading. In a highly loaded app, this can make a huge difference.
I know this discussion has been going on ever since ASP.NET was first released… but I’d say that asking whether PHP or ASP.NET is better just doesn’t make sense. There’s no such thing as the best language. The language you should use is the one that fits your needs best in the least amount of time. For some people it will be ASP.NET, and for others it will be PHP.
Still, I consider the ASP.NET platform an important skill every web application developer should have. But still, the whole point here is that you can find enough reasons to prefer or dislike any of these platforms… so it just comes down to personal preferences and project requirements.

