HostOnNet.com Forum Index HostOnNet.com
Private Label Reseller Plan
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

7 Reasons Why PHP is Better than ASP

 
Post new topic   Reply to topic    HostOnNet.com Forum Index -> Web Designing
View previous topic :: View next topic  
Author Message
admin
Site Admin


Joined: 23 Jan 2003
Posts: 256
Location: India

PostPosted: Fri Feb 14, 2003 4:34 pm    Post subject: 7 Reasons Why PHP is Better than ASP Reply with quote

7 Reasons Why PHP is Better than ASP

Active Server Pages (ASP) is Microsoft's technology for displaying dynamic web pages. ASP supports multiple programming languages; the most commonly used is VBScript. PHP is the open source alternative to ASP that runs on multiple operating systems, incuding Linux and Windows.

I think ASP is a good and useful technology, but in the long run I believe PHP will prove superior -- both technically and in popularity. There are seven reasons why I think so:

Arrow Speed Speed Speed

The first time I ran a PHP script, I said to myself, "this is a Ferrari, so fast." I was using a slow 166 Mhz PC, but you can get a lot of fast mileage off PHP.

ASP will probably never be as fast as PHP. ASP is built on a COM-based architecture. When an ASP programmer uses VBScript, he is running a COM object. When he writes to the client, he's calling the Response COM object's Write method. When he accesses a database, he uses another COM object to do so. When he accesses the file system, another COM object is called. All this COM overhead adds up and slows things down.

In PHP modules, everything runs in PHP's memory space. This means that PHP code will run faster because there is no overhead of communicating with different COM objects in different processes.

The following benchmark, where we execute a Select statement 40 times on Microsoft SQL Server 7 using PHP's MSSQL7 extension, PHP's ODBC extension and COM, will show you what I mean:


PHP Querying MSSQL7 Seconds (lower is better)
Using MSSQL extension 01.88
Using ODBC extension 09.54
Using ODBC via COM (ADO) 17.28
Using OLEDB via COM 06.19

Benchmark methodology

When we access the database using PHP's ODBC extension, it's 9.54 secs. Using the COM interface to connect to ODBC adds a 80% overhead (17.28 secs) to ODBC.

OLEDB is Microsoft's high speed COM technology for accessing databases. It is faster than ODBC, but when we use the PHP MSSQL extension we get a 200% increase in performance. So just tell a ASP programmer: No COM more speed.

Of course there is some risk that a PHP module crash could affect multiple web pages. But remember we are still in the early days of the high speed Zend engine. Today we are still ironing out the kinks from the module based PHP engine.

And this is where the benefits of the Open Source Model kick in. The constant peer-review and the world-wide test team allows the PHP team to create a production quality PHP engine much faster than any closed source company could.


Arrow Superior Memory Management

In ASP's model (in IIS 4), if an ASP file header.asp is included into 20 web pages, then 20 compiled copies of that header.asp are maintained in memory. IIS 5 has implemented an improved memory management model, but only programmers who are using Windows 2000 can upgrade because it is not backward compatible with IIS 4, and Windows NT 4.0 cannot run IIS 5. This means that most IIS web servers are still stuck with the inferior memory management model.

This is unlike PHP, which only loads include files that are required.

Arrow No Hidden Costs with PHP

One of the things I hate most when buying anything is hidden costs. You buy a car and you have to replace the engine. You buy a house and have to retile the leaking roof.

Well, buying ASP is a bit like that. Need encryption -- buy ASPEncrypt. Need email management -- buy ServerObject's QMail. Need file uploading -- buy Software Artisans SA-FileUp.

All this is built into PHP for free.

Arrow MySQL makes it cooler

PHP's integration with MySQL is simply fantastic. There are lots of PHP tools to manage and maintain MySQL databases. The feature set is complete compared to other databases. We have very useful functions like mysql_insert_id and mysql_affected_rows which are not available for other database products.

ASP and PHP are both very good solutions for mid-range web sites. What makes PHP stand out is the tight integration with MySQL. MySQL is also tuned for mid-range web-sites, where selecting and pumping loads of data is more important than transaction support. This transaction support allows the programmer to synchronise updates on multiple tables; which the majority of web sites do not require.

When we compare databases Microsoft Access is much slower than MySQL. SQL Server 7 and Oracle are nearly as fast, but much too expensive if you don't need the transaction support.

19 April 2001 Update: Many database experts have told me how foolish I am to compare MySQL with Oracle and other high end databases. This comes from a fundamental misunderstanding of how most Web sites operate. Most Web sites serve thousands of Web pages a day, but perform fewer data updates. And a typical data transaction is simple single table update for user logins or forum posts. So a database with speedy SELECTs and lousy INSERTs and UPDATEs like MySQL is a good trade-off in this environment.

Arrow Closer to Java/C++ Style of Programming

OK, the benefits of this statement is an opinion.

I agree that you won't convince a hard-core Visual Basic programmer to switch to PHP just because PHP has C or Java style for-loops, curly-braces and ->.

But you could convince someone who likes C++ or Java that PHP is a better or easier language to learn than VBScript.

PHP also has good support for modular programming in classes. Usage of classes is still rare in VBScript because of its heritage. PHP's common heritage with Java and C++ ensures a large body of programmers who uses classes all the time.

Arrow No Show Stopper Bugs

Have you ever asked Microsoft to fix a bug in ASP? If you aren't a large corporation like Boeing, the chances of getting that fix quickly are pretty low. And if it is a show-stopper of a bug, where nothing will work if this bug is not fixed, what are you going to do?

With PHP, even if you don't have the expertise in-house to fix the bug, you can definitely hire the expertise. There are no show-stoppers in PHP. Your investment is protected by the Open Source nature of PHP.


Arrow Cross Platform Migration Strategy

Microsoft is constantly tuning ASP. The next generation, called ASP+ is being previewed now. I have no doubt that they are fixing some of the criticisms I have mentioned.

But there is also no doubt that Microsoft aims to lock you down to use their products.

I used to be a Macintosh programmer. When Windows 95 came along, I switched, but most of my code was never ported over. It's still archived somewhere but I never do anything with it, much to my regret. I don't want the same thing to happen to my Windows code.

So do you have a backup strategy in case Microsoft sinks? Don't forget that at one time Novell was nearly as dominant as Microsoft in the networking arena. Today everyone is ditching Novell. It might happen to Microsoft.

I found my backup strategy. It's called PHP. I still program on Windows, but I know my PHP program will run on Solaris, Linux and many other operating systems. I have peace of mind.
[/b]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    HostOnNet.com Forum Index -> Web Designing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


For Support - http://forums.BizHat.com

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!