For beginners: Seven reasons PHP is superior to ASP

Source: Internet
Author: User
Tags execution file system file upload header odbc mssql mysql ole

  Seven reasons PHP is superior to ASP

ASP is a technology that Microsoft company realizes dynamic webpage. ASP supports some scripting languages, mainly based on Vbscripp. Compared with ASP, you can also choose another open source programming language--php,php can run under a variety of operating systems, including Linux and Windows.

Although ASP is a good technology, but in the long run I believe that PHP in the future of the technical field will be a remarkable performance.

I think there are seven reasons why PHP is superior to asp:

  1, speed, speed, speed

When I first ran the php script, I couldn't help myself by saying, "It's too fast," I was running my program on a 166MHZ machine, but it was still running fast.

ASP is never as fast as PHP, because the ASP is built on the COM architecture. When you write ASP scripts in VBScript, you actually use COM objects, and when you send a message to a user's browser, it uses the write method of the response object, which uses other COM objects when it accesses the database and file system. The use of these COM objects slows down the operation.

In the PHP code, all the work is running in the PHP memory space, that is, PHP is not based on COM objects, so he runs faster.

Here are the execution time statistics for the 40 times we ran a query in MSSQL7:

PHP Querying MSSQL7 Time (sec)

With MSSQL extension 01.88

Using ODBC extension 09.54

With ODBC via COM (ADO) 17.28

With OLE DB via COM 06.19

When we use PHP.ODBC, it takes 9.54 seconds to access the database, and a COM interface to connect to the database is 80% higher than the time spent in PHP.

OLE DB is Microsoft's high-speed access to the database technology, he is faster than ODBC. But when the efficiency of our PHP and OLE DB experiments, the result is that PHP's overall performance is 200% higher than OLE DB, so a conclusion, if not using COM can achieve faster execution speed.

Of course, PHP execution speed is not the fastest, but we are just beginning to start, we will gradually improve him, and PHP is an open source programming language, the world many programmers are constantly improving his technology, I believe he will be more than open source code system to achieve higher execution speed.

  2. Advanced Memory Management

Under the IIS4, An ASP script header.asp, if 20 pages contain, then run, in memory will retain these 20 header.asp compiled copy, IIS5 solve this problem, but only windows2000 support IIS5, because of this IIS5 not backward-compatible reasons, many The server still has to use low-level memory management under IIS4.

In PHP, there is no such problem, and only one of the include files will be invoked when require.

  3, no worries

One thing I really hate is buying a product that's not reassuring, like when you buy a car, but because the engine is bad, you need to change it; when you buy a house, you have to repair the leaky roof.

Then ASP old Township These products, when you buy the ASP, if you need encryption technology, you have to buy aspencrypt; When you need email management, you have to buy serverobjets Qmail; When you need a file upload, you have to buy artisans Sa-fileup.

  4, MySQL makes PHP more exciting

The combination of PHP and MySQL is both simple and exciting. PHP has a lot of tools to manage and maintain MySQL, and the support for MYSQK is the most comprehensive. Many useful functions, such as mysql_insert_id and Mysql_affected_rows, are not available in other databases.

Both ASP and PHP are ideal solutions for midsize sites, but the tight combination of PHP and MySQL makes PHP even more advantageous.

MySQL is wasted faster than Microsoft Access, and MSSQL and Oracle are faster than MySQL, but at a higher cost.

  5,Java and C + + into the style

This advantage is only a view.

I know you wouldn't believe it. A Visual Basic programmer will switch to PHP because PHP has Java and C + + programming styles, but you will believe that there are many people who prefer Java and C + +, and PHP is a language that is easier to learn with the programming style of both languages.

PHP supports structured programming, in VB because of his inherited use of classes or less. PHP's inheritance, like Java and C + +, makes a large program full of class shadows everywhere.

  6, the handling of the bug

Have you ever asked Microsoft to modify some of your ASP's bugs? If you're not a Boeing-like organization, you can't get a quick and proper fix, and if you stop working with bugs, you won't be able to continue your work if the bug doesn't change.

PHP, when you find bugs, you can modify him, if you do not have the expert level, you can ask the expert to modify, and your changes will be open Code organization acceptance and recognition.

  7, transplantation of

Microsoft frequently modifies ASP, the next version is called Asp+, and now the test is started. I am sure they will revise many of the problems I have mentioned. But there is no doubt that Microsoft will limit you to their product range.

I was an Apple programmer, when Windows95 came out, I began to change, but many of the original code can not run under Windows95, the code is now put aside, I am very sorry. So I don't want to have this kind of tragedy under Windows.

Don't forget that Novell used to be as hot and temporary as Microsoft's network operating system, but it's not a lot of people anymore, and so does Microsoft.

I found PHP, and I still work under Windows, but I know that PHP code can run on Solaris, Linux, and many other operating systems, and I feel comforted in my heart.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.