Re: PHP vs. ASP
| From: | Michael Kimsal | Date: | Wed, 09 Jan 2002 14:49:43 +0000 |
| Subject: | Re: PHP vs. ASP | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-79922@lists.php.net to get a copy of this message | ||
Jake wrote:
Hello there, I need some help. I have to do a technical report(about 2200 words) comparing PHP to ASP. I have already decided to make PHP the winner becasue it is superior. But I am kinda stumped on what areas to compare the two. If you could help me out in suggesting some possible areas of comparison. Keeping in mind that I need about the same amount of info on both PHP and ASP. Also if you could point me in the right direction by including some web links that deal with the topic.So, you've decided to make something the 'winner' before doing the research? I hope this isn't for a real class of any sort (something where you're getting a grade or a salary review). I'm working on a paper with an ASP expert, but it probably won't be ready in time for your needs. Databases - although PHP 'supports' many databases natively, the support is in the form of 3rd party libraries with PHP wrapper functions. Nothing inherently wrong with that, but the current method dictates that to use oracle you use oci_ functions, for mysql you use mysql_ functions, etc., giving rise to the 'database portability' issue. Yes, there are db abstraction classes available in PHP, but nothing is native to the language, and that extra layer slows things down (just like ODBC can slow things down in the Windows world). Don't go throwing 'native db' support around too much without backing it up with solid argument. If you want to make PHP the 'winner', go for price/performance. In many benchmarks you'll see one or the other winning - there's no clear cut winner by a huge margin in most situations. The 'winning' aspects are price and platform independance. Generally, my PHP code will work under Windows, Solaris, Linux, HPUX, and other platforms with pretty much identical behaviour. Not so with ASP/VBScript. Even if Windows/ASP/VBScript on machine X is 20% faster than Linux/Apache/PHP on the same machine, chances are it's probably 100% more expensive. Memory management - with Zend or APC or other cache products, PHP scripts are cached individually, so if 20 pages include() "header.php" header.php is only cached once in memory (this seems to be my view of how it works, having played with various caching systems under PHP). In the ASP world, if I have 20 asp pages which include header.asp, header.asp is effectively kept in memory 20 times, because the entire asp page (with all its includes) is cached as one file. That may be slightly faster from a processing standpoint (don't know for certain) but it's not good memory management, from what I can tell. Yes, RAM is cheap, but scripts are also getting more larger and more complex as well. Also, many people hosting on third party systems can't simply call the provider and demand an extra 512 megs be installed to get better performance. Procedural - you STILL can't actually 'include' a file in ASP/VBScript. The 'include' is an SSI directive, which is processed before the ASP engine starts. In ASP3 there is a new 'server.execute', but in the called script, you can't reference functions or variables from the calling script, so it's not as easy or intuitive as the PHP include() behaviour (imo anyway). Hope that helps... Michael Kimsal michael@tapinternet.com http://www.tapinternet.com/php PHP Training Courses 734-480-9961 Toll Free - 1-866-745-3660