When to use PHP or ASP.NET?
I have worked extensively in developing web applications using PHP and ASP.NET, but one of the questions that I'm constantly asked by customers is whether to move forward with a php website or an asp.net website.
So naturally the first thing that comes to mind is to answer the question like this:
PHP is open-source and ASP.NET is from Microsoft.
Usually after something like that is said the customer has a blank look on there face. Apparently the fact that one is open source and the other isn't doesn't really faze them. And for good reason, because when I first heard it, it really doesn't tell me much.
I know from working with both that each have their differences when it comes to developing websites.
My question is what are differences between ASP.NET and PHP as far as
- Average Development Time
I am trying to compile a list of facts to be able to compare with the customer so that an informed choice on the appropriate development platform can be made.
I've used both, I think Visual Studio and ASP.NET are much more robust. The IDE alone wins me over.
PHP will always have a soft spot for me because it was my first web programming lanaguage... but after 2 years of ASP.NET C# there is simply no way I could go back.... Visual Studio IDE is wonderful!
Yes I wish php would have some sort of main IDE, but I guess that would kill the very spirit of PHP being open source. Definetly a factor to consider.
Features, Security, and Extendability are going to be more or less the same. What can be done with PHP can be done with ASP.NET.
Frameworks — Again, when it comes to features of frameworks, it will be more or less the same. However, being more specific than the language itself, you'll want to consider:
- What your developers are most comfortable with. Knowledge = efficiency.
- On a project-by-project basis, one framework in one language might be a better natural fit than a framework in another. Being more specific than the language itself means a framework cannot help but be well-suited to some tasks and less-well suited to others.
Average Development Time — Your average development time for a very small project might be better with PHP since web hosts are so easy to find and dev machines so easy to set up. However, with anything bigger, as long as you have good devs, or are already set up for either, it will probably be a wash.
The main consideration you should make is what technology stack your client wants to be tied to going forward. Neither mixes well (easily) with the other. They may have developers who are familiar with one or the other.
If your client likes the idea of being connected to Microsoft, then go with ASP.NET. Some clients will have more comfort regarding future support, upgrades, etc. with MS.
If they like the idea of open source and Linux servers, go with PHP. This may interest some clients due to transferability of web hosts, free software, etc.
And lastly, if they don't care, then go with what you are most comfortable with. There's not much to it beyond that.
+1 for "The main consideration you should make is what technology stack your client wants to be tied to going forward."
branching off of security is there no resource to see how each platform has performed?
@loyalpenguin - that is a question in and of itself. I'm not sure what you mean by "how each platform has performed", but if you are talking about *platform security holes* (which are almost always quickly patched) that is the least of your worries. For the most part, each language is as "secure" as the developer who's writing the code.
good point.Just one last question How would I get out of the question which is more secure then?
@loyalpenguin when I say it is a different question, I kind of mean the question is "Are platform security issues a major cause for concern in web apps? If so, how do I analyze which has a better history among various platforms, such as PHP, ASP.NET, Java, Ruby on Rails, etc.?" To me, I'm not so sure that it actually *is* a large cause for concern.
I don't agree on the feature part. At least not fully. With ASP.Net you gain easy integration with the full Microsoft stack, so if your running in a Microsoft world this can be quite a thing. Also you can share code with a Desktop client application or such. PHP on the other hand allows simpler access to all those hyped ioen source tools and many "cloud" providers provide PHP API liberaries and such ...
In my experience, re "Average Development TIme" - after 17 years in the industry, and watching PHP and .NET from the start and being involved in many projects, i honestly think that PHP projects get off the ground faster every single time. C#/.NET sort of feels cleaner and more robust, but PHP development time leaves it for dead IMO.
@Manachi You are probably right and this subject is probably worth more than the 1 paragraph I gave it. I should have said if you control for project quality... it will be a wash. I 100% agree with you, PHP will reach deployment faster when considering *all* cases -- with the most typical case (especially in the 4 years since I wrote this answer) being somewhat of a rush job (commodity programming) or written by amateur developers.