Question:
Differences between ASP.NET and PHP?
Tristan
2009-12-03 03:20:44 UTC
hi im looking to start building my first web app. i have researched in ASP.NET and PHP but still can find out which would be better to use.

i looking for what differences they have to each other, eg database connections, security implications etc.

also what are the advantages to using either and is there disadvantages for examples problems im likely to encounter.

if any one could help me out it would be hugely appriciated.
Six answers:
anonymous
2009-12-03 10:06:51 UTC
PHP and ASP.NET are two of the most widely used languages for development of web applications. Both allow development of complex and sophisticated sites, but both are very different.



PHP is a language. PHP consists of a platform-independent engine that parses PHP scripts. This language also provides common web application functionality such as database connectivity.



ASP.NET is not a language, but a technology and is a small part of the .NET Framework. The Dot NET Framework consists of a) CLR – Common Language Runtime which manages execution of the code b) a hierarchical set of class libraries. These libraries are extensive and provide a great deal of functionality both for web-based applications and well as windows-based.



ASP.NET framework is built entirely on an OOP paradigm and OOP concepts while PHP is not.



PHP does not follow the OOP paradigm entirely. It only supports partial encapsulation, and partial polymorphism.





Compilation is also different in PHP and ASP.NET.



In PHP, when a page is requested, the HTML and inline PHP script is compiled to binary format called Zend Opcodes. Once compiled, the opcodes are run by the Zend Engine and HTML is generated which is sent to the client. Commercial products are available that increase the speed at which PHP pages are executed.



In contrast, when an ASP.NET page is first requested it is converted into an intermediate language called MSIL (Microsoft Intermediate Language). The CLR then converts this MSIL to machine code. Conversion to machine code only takes place once for each page request (unless code has been modified). All subsequent requests use the already generated machine code. In ASP.NET no optimization product is required as the MSIL generated is already in its most optimized form.
PhonicUK
2009-12-03 03:39:12 UTC
The biggest difference is that ASP.Net is a lot faster than PHP. This is because .Net code is compiled as .Net CLR (Common-Language-Runtime) which is JIT compiled to native machine code.



PHP is interpreted at runtime, making it slower.



Also, PHP has no concept of 'code-behind' , which is where code to generate the page itself (purely from a design and looks perspective) is kept separate from the underlying logic.



Also ASP.Net controls allow for triggered events. For example you can have a piece of code that executes when a button is pressed, without having to set up a form - write a handler when the page is loaded, and display the result.



ASP.Net also has better support for parametrized queries, and strongly typed data (Infact, PHP is loosely typed) which makes it much easier to write secure backend code that connects to a database that dosen't get hit by SQL injection attacks.



I have to code in PHP full time, but would much rather use ASP.Net.
deonejuan
2009-12-03 06:55:24 UTC
ASP.NET is Microsoft and PHP is Open Source. You don't need a license for PHP, you join the majority of installations out there on the web, you gain a community ready to help you. Linux is the better web development platform. Period. And the combination of LAMP is a quick install of Linux, Apache, MySQL, python-PHP-perl, with the equivalent WAMP for Win platforms.



No matter what other arguments about ASP.NET, it is still Windows and susceptible to viruses and the whims of the LICENSE that Microsoft grants you. Read the EULA on any Microsoft product and they grant you a License and not ownership. Furthermore, they reserve the right to discontinue service at any time without notice and do give the government access to your work(s). It takes forever and a day for a Windows product to warm up while it runs virus scans and file inventory before granting you full access.
.Paul
2009-12-03 03:45:26 UTC
ASP is rather outdated compared to PHP in general.



PHP is very flexible and pretty much endless to what you can do with it. Now days, web programmers choose PHP because of the flexibility and and speed of it. Supports numerous of caches and databases too.



You can looks are huge companies that use PHP for their software and how fast it runs. The award winning bulletin board, Invision Power Board is a great example.



http://forums.invisionpower.com/
just "JR"
2009-12-03 09:39:39 UTC
The best is Php.

Go to http://www.web2coders.com and click on "articles". Read "ASP v Php" from Nadav (author).

The conclusion does not give you any choice!

Here is a part of it:

Quote:

"

PHP, [www.php.net], while loosely based on C and Perl, has never faced the overwhelming complications ASP has. PHP is an object oriented language - though scripts need not necessarily be developed that way (there are still a vast number of developers preferring procedural programming, and PHP caters to both schools). PHP is both cross platform and open source, available for every major operating system and works with most web servers. It is easily extendable by anyone capable of coding in C, and comes pre-bundled with more functionality than ASP could ever offer. Simple capabilities, such as FTP, data compression, file uploads, XML, MD5, encryption and email are not included in ASP and require expensive, third-party packages to be installed. All of this functionality and more are built right into PHP. Complex functions such as dynamic images, IMAP, SNMP, dynamic flash, PDF, native access (non ODBC) to Oracle, Ovrimos, Postgre, Sybase, mySql, MSSQL, Ingres, Interbase and Informix databases, LDAP, and sockets, just to name a few, are available for free to any installation of PHP, but are not (and probably never will be) available with ASP. In addition, one could make the point that PHP is a more mature language than ASP. ASP has only been around since 1996; PHP has been around since 1994, and has a huge base of developers working on it every waking minute of every day; bugs are usually fixed within minutes of being reported and new features are being integrated daily.



1) ASP is significantly slower than PHP, for obvious reasons. Primarily, PHP runs on notoriously fast Unix and Linux servers which have for years outpaced Windows running on comparable hardware. ASP does not run on any operating system other than Windows, and even then, only in IIS and PWS. I could discuss countless reasons why IIS makes a terrible web server, but that would be a discussion all on it's own. PHP runs on almost any web server, on ...

"

Unquote.

Why anyone still use ASP is, really, beyond me...
salguero
2016-10-04 05:56:52 UTC
Lust is totally actual - you prefer to have intercourse with this person, grope this person. All physique stuff. Love is emotional - specific, there are factors of lust in love yet for the main area that is desirous to be with that person, communicate with that person, cuddle, and to stay with them continually. tl;dr Lust leaves once you benefit some pounds, love maintains to be and asks in case you like cake.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...