What are the fundamental differences between ASP.net and PHP?

49,776

Solution 1

Microsoft has published a great overview of migrating from PHP to ASP.NET which reveals differences and similarities.

http://msdn.microsoft.com/en-us/library/aa479002.aspx

Solution 2

ASP and PHP are similar in that both tend to put their code in with the HTML, and so the logic can be quite similar.

But, ASP.NET will be very different from PHP in design, as there is a strong incentive to use code-behind in ASP.NET, where you basically have the html template and all the code is in another separate file

Depending on what you are doing, how busy your site is, you may find that the speed difference is inconsequential, though one is compiled and the other isn't.

PHP is probably going to be faster to develop, as you can more easily code a little and test, than you can with ASP.NET, but ASP and PHP are similar in how you can develop.

If you don't know any of these languages then PHP may be the easier one to learn, as the php manual is so well written, with lots of comments from users, and ASP.NET has replaced ASP, so learning ASP for a new project, IMO, is of limited use.

If you go with ASP.NET then you are learning a new syntax and one of the .NET languages, but depending on your background, C# may be relatively easy to learn.

With ASP or ASP.NET you are stuck with using IIS for your server, but with PHP you can use IIS or Apache, so there is considerable flexibility there.

With ASP.NET you will find more options to help with code development, as they now have the classic ASP.NET and ASP.NET MVC (http://www.asp.net/%28S%28d35rmemuuono1wvm1gsp2n45%29%29/mvc/), both with pros and cons, but I believe this site is still written in the latter.

So, which would be better depends on what you are going to be doing with it, and what languages or frameworks you have already gained experience with.

Solution 3

The Microsoft route will have a better learning curve if you are coming from a VB6 or other Microsoft platform. You'll probably have more hardware & licensing requirements to run the Windows Server/IIS/SQL Server/.NET platforms than LAMP. Whether or not you can manage one better than the other is a matter of skill set & probably opinion.

Solution 4

An really important feature of .NET is that it can be used for developing web apps (ASP .NET), desktop apps, web services, Palmtop development, in short pretty much anything (the only problem being it is not cross-platform, unless you count the open source Mono project, which is coming along well). So ASP .NET is only one part of its capability. If you were writing a suite of applications for desktop, web, palm then the same business logic libraries could be re-used for all of these projects. PHP is pretty much web-only and is specialised in that area.

If you are only interested in creating a web app, then PHP competes well and the learning curve would be much smaller.

.NET is in essence Java rebadged and developed further, with the cross platform capabilities removed.

Solution 5

The most fundamental difference between the two is the language. PHP uses a C-like syntax, while ASP uses Visual Basic as its syntax.

ASP.NET, however, is an entirely different beast; I note you've listed ASP in your title, but ASP.NET in your tags.

ASP.NET is a templating language that can work in front of any .NET programming language, the most common being C# and VB.NET. ASP.NET uses (and comes with) the .NET framework, and is far more object-oriented than either PHP or ASP.

In general, PHP and ASP will seem faster for many tasks, but ASP.NET will provide a better chance at building a robust, maintainable application.

Share:
49,776
palbakulich
Author by

palbakulich

Graphics designer, Ubuntu Geek

Updated on March 08, 2020

Comments

  • palbakulich
    palbakulich over 4 years

    Possible Duplicate:
    .NET & ASP vs PHP

    Are there speed differences, performance issues, and what reasons do businesses have when they choose one or the other, is the learning curve steeper for one over the other?

    Also... are you likely to be paid more using one over the other?

    • palbakulich
      palbakulich over 14 years
      I did notice this question here... stackoverflow.com/questions/2135479/… If possible, I would like to concentrate on performance and the learning curve and why people choose between one or the other when developing an application.
    • Francisco Aquino
      Francisco Aquino over 14 years
      Your title vs the tags you put can lead to absurdly confused answers. Please consider being more consistent since ASP and ASP.NET are different. ASP is legacy tech currently but is the one comparable to PHP because of its mechanics, see the problem here?
    • palbakulich
      palbakulich over 14 years
      F.Aquino - noted your concern, have edited, hope that clears up any confusion. Thanks for the heads up!
    • John K
      John K over 14 years
      Yes, but the quality of that duplicate question sucks to say the least and the chosen response to it is very argumentative. I'd rather that one be linked to this one.
  • RageZ
    RageZ over 14 years
    ASP.net use whatever language has his syntax c#, VB and all the the other stuff got in dotnet ....
  • Decent Dabbler
    Decent Dabbler over 14 years
    Correct me if I'm wrong, but I believe old skool ASP was also able to be programmed with other languages than VB. I believe there even was a JScript ASP language.
  • palbakulich
    palbakulich over 14 years
    Thanks for that link, it was very helpful.
  • Seva Alekseyev
    Seva Alekseyev over 14 years
    ASP classic could use any language for which an Active Scripting engine was installed. In practice, it would mean either VBScript or JavaScript; the latter was preferable (try/catch, classes, first-class functions, etc.). The tutorials and stock examples all used VBScript though, so a misconception was going on.