What is the biggest advantage of ASP.NET over the PHP. Why should I switch to ASP.NET?
EDIT: I just want to understand the point behind the Joel's example: If ASP.NET is a Lexus, then PHP is a bicycle.
What is the biggest advantage of ASP.NET over the PHP. Why should I switch to ASP.NET?
EDIT: I just want to understand the point behind the Joel's example: If ASP.NET is a Lexus, then PHP is a bicycle.
It is all a matter of preference. We do both PHP and ASP.NET
I feel better doing ASP.NET with C# as I like the syntax, the framework, etc. PHP has still a more scripting-like feel to me.
But again, it is a matter of personal preference.
Try out both?
As a user of both, I love the Forms nature of ASP.NET (e.g. being able to reference the text of a textbox with mytextbox.text in the code. If your application contains lot of data entry then .NET makes life much, much easier.
I'm also a big fan of Master pages and theming, features which can be replicated in PHP, but its nice having it out-the-box.
As a recent convert from PHP to ASP.Net, my 'likes' are: Linq, Workflow, built in AJAX support, events, a more consistent internal framework, MVC, and in general having most things right there without having to resort to trawling multiple websites for add on functionality.
In addition to the above, the Membership Providers functionality that ASP.Net brings to the table is simply fantastic in itself for simple websites, ViewState is a godsend in most situations, and being able to bind datasources to controls rather than having to populate drop downs manually etc.
I'm sure I will be adding more as I think of them.
visual studio is a good answer, dot notation language (C#) is another
imho it's not really a choice you have to make, it depends where you work - LAMP shops will continue to use PHP generally, MS shops will continue to use asp.net, never the twain shall meet
you probably need to learn both to a some degree to be a really handy web-dev
edit: I have to say a lot of the things people cite as advantages (built-in ajax, controls reference server-side) I actually find to become ever more of aproblem the deeper you get into asp.net, where php offers no help in these areas it also doesn't get in my way
I'm an ASP.Net guy myself. Strict typing, the code is separate from the html and can be compiled into assemblies so you don't need the code on the server.
And, of course Visual Studio is an awesome tool - even the free version.
Monodevelop is coming on too - the latest alpha has intellisense for ASP.Net which is hopefully all I'm waiting for before I can switch for my personal programming.
There are a couple of problems with ASP.Net - watch out for the viewstate etc but they can be worked around pretty easily.
Strongly typing, a HUGE source of Open Source libs to use, OOP (truly OO programming) which makes it far easier to use these 3rd Party libs and many more...
My favorite though would definitely be that you get to use Ra-Ajax ;)
PS!
When that is said, I think this was a very mature thread. I don't think I've ever seen someone ask questions like that without starting a war...
As in; Nice work Jeff and Joel ;)
As a develper who has had experience with both ASP.Net and PHP I greatly prefer to develop with ASP.Net. I will only develop using PHP if I absolutley have to (due to hosting restrictions, or because it is legacy code).
The crux of the matter is that ASP much more feature rich when compared to PHP. When developing in PHP I feel as if I constantly have to reinvent the wheel, and have to concentrate on how I will perform tasks instead of what I am trying to do.
.Net allows you to focus on the problem you are trying to solve rather than how you perform the steps involved. This is what rapid application development is all about.
A very good example would be the data access features introduced in VS2008 (LINQ to SQL, LINQ to XML, Entity Framework). All of these technologies provide a very rich experience for the developer, giving them a visual representation of their data model and making it very easy to maintain.
There are so many compelling features you can take advantage of when you move to .Net, you really need to try it out!
Regards,
Docta
I'm working for a PHP shop and one thing I seem to spend a lot of time on is form creation / user interaction with the form. I'm not talking about backend stuff just the frontend stuff. From what little I've played with ASP.net I want to switch so bad just to cut down on the time I have to spend writing forms.
If you compare baseline PHP to ASP.NET the MS product is way ahead. If you add a couple of frameworks like Zend, Doctrine and PHPUnit to the php stack, the scales will tilt the other way.
I, personally, like PHP a lot more than ASP.NET (being both an ASP.NET dev and PHP) - PHP has dynamic typing - no casting and type errors - PHP has a lot of libraries with it. If thats not enough - consider looking at pecl for more. - PHP is OSS
I'm not considering language performance since I believe productivity has a much higher priority than it.
And there's always Phalanger, which allows you to compile PHP code to run on the .NET Framework. I've never used it, but I'm assuming that you can use it to make some kind of web app, and perhaps integrate it with an ASP.NET app.
If this works the way I understand it, you might not have to switch from PHP at all to make ASP.NET applications.
The bicycle metaphor:
PHP is a scripting language it's easier and faster to pick up.
You can just get on it and drive to where you want to go.
Sometimes when you have to drive further, you want something which drives faster and gives you a bit more comfort while driving.
.NET can deliver this :)
The why's of that statement you can find int the other answers.
Of course you could always look at the article entitled "Does Visual Studio Rot the Mind" by Charles Petzold (http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.htlm) Charles Petzold, you will no doubt remember was a major writer on Windows topics.
Alan
Some additional thoughts: I have the same question, I've worked with asp.net 1.1 and 2.0 and php4 and 5.
Php there are many libraries and frameworks and it takes much time to choose which one to use. Many of asp.net's features are present in Zend framework (example, there are many others). Also Zend Studio (or eclipse) have many elements that people like in visual studio. The thing is that choosing needs time :-(
The biggest consideration for me is that by choosing ASP.net you start to go in a place where all things are (or becoming) Microsoft. Asp.net equals Visual Studio this means Windows as an OS, better integration with SqlServer, etc. Or that a open source tool you use may just... die because newest VS has something similar integrated (adding to the list of things you have to relearn).
The Base Class Library blows the PHP Class Library out of the water.
PHP is not bad and it certainly gets the job done, but you can clearly see it's organic growth:
This is maybe more of a perception of myself, but I have (had to) changed from PHP to C#, and I would never ever go back. PHP seems like a loose collection of functionality without any direction or consistency, whereas .net looks a lot more planned out. Visual Studio is better than Zend Studio (have not tried the Eclipse-based one yet though) and Debugging with PHP is a PITA. (And no, var_dump/print_r is not real debugging, and neither is response.write in .net)
On the other hand: .net usually requires a Windows Server, which immediately makes it a lot more expensive in terms of initial cost.
Many people think they know PHP when in fact they dont. So their code is wrong/slow/insecure and they recode a lot cause they dont get the right tools/frameworks for the job.
Its easier to do the right thing in ASP.Net and most other comparable languages, and you get the default tools/frameworks right there.
In my market, PHP programmers on average earn about 1/3 less than ASP.NET programmers. ;)
Not what the poster intended as an answer, but certainly important to me (as a .NET expert and professional).
asp.net application are difficult to edit/manipulate.while php you can manipulate a lot.to do simple application asp.net might be okays for you while for advance application business logic ,i prefer php rather then .net solution.In php can generate complex application with dynamic sql faster rathen then asp.net solution mostly depend on store procedure to hide business logic.