DISQUS

DISQUS Hello! php programmer of bangladesh is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

Which one and Why? PHP or ASP.net

Started by masudiiuc · 9 months ago

I was searching in google for something and find a article of a developer where he describe the difference of PHP and ASP.net. I read the article and found the points very userful.
There fore i would like to share the link with all of you.
Look this before go to the link:

About the auth ... Continue reading »

8 comments

  • Hi!

    I wonder why the image says ASP.NET is weak in speed and efficiency. I find it quite good in reducing development time and several performance tests indicate that it runs faster too.

    -Nitin
  • PHP is never compiled in the sense that an ASP.NET page is compiled. After the first run of an ASP.NET page, if you use in-page code for your .aspx files, the page is compiled and the code is literally machine code. If you use code-behind, then your page will always be compiled into the DLLs.

    PHP compilations involve the PHP engine changing it to the executeable form of the page (similar to how Java uses byte code in its "compiled" state). Furthermore, the only way to then achieve similar speed to ASP.NET is to CACHE the "compiled" version of the PHP scripts. This is how the Zend Accelerator works.

    At no point does the PHP code ever become machine level code.

    As to running PHP vs ASP.NET on a Linux server, there is Mono (go-mono.com) so that you can run ASP.NET on a Linux server, but maybe due to a poor implementation it has speed problems? I don't know, I have never used .NET on a Linux machine. My first guess is that ASP.NET is still faster on Linux than PHP.

    Scripts cannot beat machine code because at the end of the day, you're running another program in order to execute the script, while the machine code runs as is.

    Please take a look at this article. Very funny:
    http://compsci.ca/blog/if-a-programming-languag...
  • @Artem

    I read your point of view. as i mention i have never used asp.net, so i get knowledge from your comments.

    Bye the way the link was superb :)
  • I read the original article, and it's apparent that the author has either never actually used ASP.NET, or hasn't properly researched a number of claims made in the article.

    Database Access
    The author states that .NET forces you to use an ODBC driver. In fact, .NET ships with optimized data providers for ODBC, OleDB, SQL Server, and Oracle. The data framework is interface-based and extensible, meaning that you can write optimized drivers for other database backends. Open source drivers are available for MySQL (http://dev.mysql.com/downloads/connector/net/1....), PostgreSQL (http://npgsql.projects.postgresql.org/), and other data sources.

    Execution Speed
    Artem is correct - .NET pages are compiled to intermediate language, and then machine language the first time they are accessed. The compiled page is then cached as a DLL for subsequent requests. Contrast this with PHP which must parse and interpret the page for every request.

    Environment
    You can certainly get .NET running under Apache without having to proxy requests to IIS (http://weblogs.asp.net/israelio/archive/2005/09...).

    Cost
    The .NET runtime, compiler, and SDK are available as a freely redistributable download, and there are a number of freely available development environments (SharpDevelop or MonoDevelop on Linux, Eclipse plugin). If you want to run .NET apps on a Linux server and avoid all licensing costs you can always go with Mono as Artem mentioned.

    Although I'm primarily a .NET developer I'm not really advocating one technology or the other. Just make sure that you're making your decisions based on accurate information.
  • If you plan to use ASP.NET. I prefer C#. Check out great product ANTS Profiler developed by RedGate. You can quickly identify performance bottlenecks and optimize your .NET application accordingly. Unfortunately it is not free product but worth to have.
  • @Ken Jacobs

    Thanks for your nice answer. it makes me clear about the features of ASP.NET.


    @Artem Gassan

    Thanks to you also for your nice suggestion.
  • Duh, i completely agree with the things below. In fact you can't compare it with PHP

    ASP.net -->

    Platform price $$
    Speed: WEAK ( as you are comparing with PHP )
    Source available ? ( NO )
  • i want the zend certification books.i you will help me this will be very helpful .thanking you

Add New Comment

Returning? Login