Home » Linux, Open Source, Web programming, Webmaster, Windows

PHP and ASP.NET Side By Side

12 June 2009 No Comment

Developers wishing to create dynamic websites, web applications and web services with a database back end are presented with two main stream choices. Develop for PHP and MySQL or ASP.NET and possibly Microsoft SQL Server. Both technologies have their strengths and weaknesses and there are those who biased towards one technology over the other. How do PHP and ASP.NET compare?

Since Microsoft released ASP.NET, there has been a widespread debate among developers about the merits of ASP.NET over PHP. One is Microsoft’s commercial web development technology and the other is an open source web development language which is best known when used with Linux, Apache and MySQL (together the combination of Linux, Apache, MySQL and PHP is often referred to as LAMP).

Both ASP.NET and PHP run on the web server (unlike something like JavaScript which runs in the client web browser). Web pages are dynamically generated as they are fetched from the web server and the language controls what and how the pages are displayed. Each language supports a variety of features including back-end database support, XML, mathematical functions, cryptography, text processing and web services.

PHP is open source and the majority of server type Linux distributions (and some desktop ones) offer Apache, MySQL and PHP as part of the normal installation.

ASP.NET is developed and marketed by Microsoft and therefore only runs on the Windows platform (unlike PHP which, besides Linux, runs on Windows, OS X, FreeBSD and others). ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. Note: There is also an open source implementation of .NET (including ASP.NET) called Mono.

To compete with the open source world, Microsoft give away the special ‘Express’ version of their software (including Visual Studio and SQL Server) which allows developers to start writing with ASP.NET without buying any additional software from Microsoft.

Looking at PHP and ASP.NET side by side there are a number of important differences to note. First PHP is C like in its structure and can be simpler for developers to learn, especially those familiar with the C language. ASP.NET is different in that web pages can be developed in any language supported by .NET. Traditionally this means Visual Basic or C#. Although PHP has some objected orientated (OO) functionality C# is a full OO language.

Another big difference between PHP and ASP.NET is that PHP is interpreted code while the programming language parts of ASP.NET (like VB and C#) are compiled. Technically, VB and C# are compiled to an intermediary language and then at run time it is compiled into native code. The upshot of this is that ASP.NET web services or applications should be faster.

Although not open source, Microsoft do offer the Visual Studio Express IDE for free. The Visual Studio IDE is a professional application and it is the IDE that the majority of Windows developers use even for desktop applications. It has syntax highlighting, command completion and built in project organization. It also includes a good debugger which is something that PHP sorely misses. To be fair to PHP, developers can get Zend Studio (from the makers of PHP) but it is not free.

Related links:

Choosing the right technology to create your dynamic website – ASP.NET, PHP, MySQL, SQL server, the list goes on | Gaj-It.com – UK Gadget and Tech News, Reviews and Shopping

Post to Twitter Tweet This Post Post to Digg Digg This Post Post to Reddit Reddit Post to StumbleUpon Stumble This Post

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

CommentLuv Enabled