Pros and cons of PHP and ASP.NET

What are the relative pros and cons of PHP and ASP.NET as web building technologies?


Answer 1, authority 100%

ASP.NET is simpler than PHP in the sense that you need to write less to accomplish the same task. Authentication, authorization, saving the state of a reloaded page, grids with automatic data binding, AJAX and other typical things are built into the core of ASP.NET. In addition, the architecture of classic ASP.NET is component-oriented, that is, the Web page is presented as a form on which you can throw controls and components, subscribe to their events, and the ASP.NET infrastructure itself will resolve this so that the user renders the desired html + javascript that reacts to its actions in such a way that the logic for processing these events is executed on the server. Another advantage of ASP.NET is that the application is written in strongly typed compiled .NET languages, and therefore the technology greatly simplifies debugging compared to PHP.

But ease of development comes with a price in terms of traffic. In order for this infrastructure to work, each user action requires a reload of the entire page, or at least an updated AJAX panel. In addition, in order for the page to save the data entered by the user when reloading without additional actions on the part of the programmer, this data must be duplicated in an invisible component called ViewState, and a rather large bitmap smeared into a string races back and forth along with the page. So it’s the end user who pays for the ease of development when using ASP.NET WebForms.

ASP.NET MVC is an attempt to bring ASP.NET closer to PHP in terms of performance. In this technology, there is a rejection of the component architecture in favor of server inserts and the allocation of Master pages. A master page is a template on the basis of which specific pages are created by inserting specific content templates into specified places. All content is written in pure html + javascript + server-side inserts, which allow, when rendering a page, to insert into it the code generated by the controller written under the CLR. Thus, ASP.NET MVC is a rejection of almost all the advantages of classic ASP.NET, except for a strongly typed language for developing logic, in order to combat the main disadvantage of this technology.


Answer 2, authority 75%

There are no pros and cons – there are different concepts.

  • ASP.NET is geared towards large projects. PHP for smaller projects.
  • ASP.NET is considered more correct, PHP is more soviet.
  • There are many libraries for PHP, when you write a component for ASP.NET – you don’t have to write it a second time.
  • ASP.NET developers get more PHP developers.
  • PHP is interpreted, ASP.NET is compiled
  • ASP.NET works a little slower with a small load, with a large load due to compilation it works faster (I don’t remember where I read the source)
  • PHP has many templating engines to choose from, ASP.NET has templating built in

Stability depends on the hands of the sysadmin.

About the fact that ASP.NET is only on Windows – ASP.NET on Linux.


Answer 3

PHP is better for me. it can be programmed even on the phone. yes, and keeping the server on Windows mine is josco…