Marty Anstey Logo
 About Me   Hobbies   Business   Programming   Photos   Projects   More... 

PHP vs ASP
By Marty Anstey
May 22, 2003

There have always been innovative revolutions in the world of the Internet; they are in fact the foundations upon which it is built. Without this never-ending stream of creative energy, the online world as we know it today would never have been. The history of the web browser is a classic example of how innovation drives progress on the net; the very first browser, known as WorldWideWeb, was developed in 1990 by Tim Berners-Lee. It only took a couple of years to catch on, and in 1993, Mosaic was released, which is still regarded today as the first true web browser. Mosaic remained the staple browser for a number of years, and was licensed to various companies, including Microsoft for use in Internet Explorer. After Mosaic, a number of other browsers were released, some of which remain in mainstream use (most notably Opera and Mozilla in 1994, followed by Internet Explorer in 1995) quickly dwarfing earlier browsers in their functionality.

While web browsers demonstrate only one facet of the innovative progress of the net, it is perhaps one of the most striking examples considering the explosive growth following the web's inception. Whereas early browsers were limited in their functionality, within five years they had grown to the point where they made the web a viable tool; providing a truely interactive experience to anyone with access to an Internet connection and a computer. This is truly where our debate comparing PHP to ASP begins, back in the dark ages of the Internet.

HTML, the fundamental building block of the net, remains largely unchanged since the first browsers. Back end programming, however, has been experiencing growing pains since CGI was introduced. Traditionally, web pages were given added functionality via CGI, programs typically written using traditional programming languages such as C or Pascal, or Unix shell scripts. One of these, known as Perl (originally developed in 1987) quickly became a favorite among web developers for it's easy integration into web pages. Perl is still in widespread use today, offering a powerful set of features and is easily extensible via a huge collection of modules available from CPAN (Comprehensive Perl Archive Network). Perl's main drawback lies in the fact that although it boasts a highly flexible and powerful language, it is fairly complex, usually proving unduly daunting for beginners; especially to those who have never programmed before. In addition, Perl is a CGI script, which has a marked abstraction from the tight integration of HTML and 'web-specific' languages such as ASP, ColdFusion or PHP - that is, it's very difficult to build dynamic websites using Perl.

Perl remained the mainstream solution to web backend programming for several years until 1996, when Microsoft introduced a product known as Denali, which used the VBScript language in an attempt to attract disenchanted web developers yearning for a simpler alternative to Perl and C. In late 1996, Microsoft renamed Denali as ASP 3.0 and released it to the public bundled into IIS at no charge. The concept caught on, and ASP quickly grew to become one of the most popular web development languages, partly due to the Microsoft marketing machine, and also due to the timely release of a much desired concept; inline code, coupled with a simpler language, provided the right conditions for a multitude of up-and-coming web developers to jump on the bandwagon.

1996 proved a pivotal year for back-end web development as a new web language called PHP was gaining popularity. PHP is an recursive acronym for PHP Hypertext Processor, originally started in 1994 by Rasmus Lerdorf as a Perl wrapper to simplfy his back-end programming. By the end of 1996, PHP was in use by 15,000 pages. In 1997 PHP3 - the first widely-used version of PHP - was released, growing explosively to being used on over one million sites by the time PHP 4 was released in April, 2000. PHP's rapid growth signifies a marked change in the direction of web development, a paradigm shift from awkward and time-consuming back ends of Perl through kludgy ASP and now to streamlined PHP. PHP draws it's strengths from C and from Perl; the language is simple and easy to understand. PHP's simple structure allows beginners to easily pick up the language while advanced tasks, such as file uploads, graphics manipulation and database connectivity are easily within reach of the beginner. PHP's vast power and unsurpassed functionality is derived from the huge storehouse of built-in extensions that are bundled with each PHP installation, offering far more functionality than could ever be desired by the most wanting developer.

The web has grown significantly since it's inception, and user's expectations of a website have grown substantially as well. Most of ASP's functionality now pales in stark contrast to PHP's gleaming capabilities, but still one must consider the multitude of developers throughout the late 90's who studied and learned ASP, went to school and even got jobs developing ASP websites. Most of these developers were fresh out of school, having learned (what they thought) was the next best thing, and after the Internet boom died away, moved into different fields or different industries altogether. But in their wake remains a large number of websites developed using this outdated language, many of which work just fine in their current incarnation and have been for some time. Also remaining are a significant number of diehard ASP developers supporting these pages and even building new ones using this outmoded technology.

But realistically, let's get with the times; what was ASP is no longer. Microsoft has dropped support in favor of ASP.NET, which is about the furthest thing possible from what ASP was. No longer is VBScript the preferred language of choice, but C#, Microsoft's new (and surprisingly decent) contender which threatens to (if it hasn't already) completely decimate Java's position. And what of the lowly ASP developers of yore? Time to move on, folks. Microsoft, without openly admitting it, has put the final nail in the coffin of traditional ASP with .NET. Sure, support still exists and probably will for some time; but developers who bought into Microsoft's vision have no choice but to follow suit and learn C#, a language very similar to C and Perl and precisely what ASP originally intended to replace.

PHP, 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, mSql, 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.

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 almost any platform. I have even built a web server in PHP which was capable of executing PHP scripts.

ASP natively supports only Access and MSSQL, whereas PHP natively supports a huge number of databases. They both support ODBC equally well. MySQL is a database that PHP closely integrates with; it is a very powerful database that rivals Oracle in speed. Like PHP, MySQL is free, and blows most other databases out of the water. Another hidden cost with ASP is the database angle; Microsoft expects you to develop using Access and when your webpage outgrows it, to switch to MSSQL, an extremely expensive option. What most people don't realize is how quickly you can outgrow Access. Although you're technically limited to around 30 simultaneous connections, realistically it's closer to 5. Not many websites can survive such limitations. Most moderately sized websites require over 1000 simultaneous database connections. In addition, Access is SLOW. And you forego a lot of cool database functionality such as stability, transactions, replication, stored procedures, triggers, and so on. There are so many reasons not to use Access, I can't even begin to elaborate on them here.

While even the best software has glitches, PHP has notoriously few. The PHP development team has an outstanding reputation for fixing bugs, and in order to streamline the process they even have an online system through which new bug reports can be submitted. Most bugs are resolved within 24 hours, and I'm speaking from experience here. There are a huge number of outstanding bugs in ASP which will probably never be fixed. Unless you're a major corporation, chances are that your bug report to Microsoft will likely go unanswered.

And finally, cost. PHP is free. ASP isn't free. If you want to use ASP, you have to use IIS, and if you want to use IIS, you have to buy Windows. Traditionally, the cost of Windows has been high. Microsoft has been aggressively trying to reduce this factor but they're hardly going to give Windows away for free. The cost of running an ASP-based website implies a full Windows server platform; development costs are higher, software licenses are expensive and speed, security and flexability are all sacrificed.

There's a reason that Unix and Linux are dominant in the server market; money, security and performance all speak volumes.



Want to republish this article? Please contact me first. Thanks!




  :: News
 January 1 2010
Wow, is it 2010 already?
 January 1 2009
Welcome to 2009!
 July 29 2008
If you're into folk-rock music, check out the latest album by my dad, R.G. Anstey
 January 1 2008
Happy new year!
  :: Features
  :: Links
  :: Search the Site

Home - Writing/Poetry - Programming - Projects - Music - Travel - Guest Book - Calendar
Business Ventures - PHP Scripts - Web Spiders - Search Engine - Links - Contact Me

Constructed entirely by hand using only TextPad and PhotoShop
Modified Tuesday June 13, 2006 - 23:30 UTC

(C) Copyright 2000-2010 Marty Anstey ~~ I didn't rip you off, so don't rip me off.