Seven reasons why PHP is better than ASP

Source: Internet
Author: User
Tags php and mysql

Original article link

SP is a technology that Microsoft uses to implement dynamic web pages. ASP supports some scripting languages, mainly vbscripp. Compared with ASP, you can also choose another open-source programming language, PHP, which can run on multiple operating systems, including Linux and Windows.
  
Although ASP is a good technology, I believe that PHP will do well in the future in terms of technology in the long term.
  
I think there are seven reasons why PHP is better than ASP:
  
1. Speed
  
When I ran the PHP script program for the first time, I couldn't help but say to myself: "It's too fast." At that time, I ran my program on a 166mhz machine, however, the running speed is still very fast.
  
ASP is never as fast as PHP, because ASP is built on the com architecture. When Using VBScript to write an ASP script, actually COM objects are used. When sending information to a user's browser, it uses the write method of the response object, when it accesses the database and file system, it uses other COM objects. The use of these COM objects reduces the running speed.
  
In PHP code, all the work is run in the PHP memory space. That is to say, PHP is not based on COM objects, so it runs faster.
  
The following is the execution time statistics of a query statement running at mssql740:
  
PHP querying MSSQL7 time (seconds)
Use MSSQL extension 01.88
ODBC extension 09.54
ODBC via COM (ADO) 17.28
Use oledb via COM 06.19
  
When we use PHP. ODBC, it takes 9.54 seconds to access the database, and it takes 80% seconds to connect to the database using the COM interface.
  
Oledb is Microsoft's high-speed database access technology, which is faster than ODBC. However, when we tested the efficiency of PHP and oledb, the result was that the overall performance of PHP was 200% higher than that of oledb. Therefore, we came to the conclusion that if we didn't use Com, we could get a faster execution speed.
  
Of course, PHP is not the fastest to execute, but we are just getting started, we will gradually improve it, and PHP is an open source programming language, many programmers in the world are constantly improving his technology. I believe that he will certainly get a higher execution speed than non-open source code systems.
  
2. Advanced Memory Management
In IIS4, an ASP script header. ASP. If it is contained by 20 pages, these 20 headers are retained in the memory during running. iis5 solves this problem, but only Windows2000 supports iis5. This iis5 is not backward compatible, many servers still need low-level memory management under iis4.
  
In PHP, this problem does not exist. Only when require is used can an include file be called.
  
3. No worries
One thing I hate very much is to buy an uneasy product. For example, if you buy a car, but the engine is bad, you need to replace it; when you buy a house, you need to repair the roof that leaks.
  
ASP is like these products. After you buy ASP, If you need encryption technology, you need to buy aspencrypt; when you need email management, you need to buy serverobjets Qmail; when you need to upload files, you need to buy artisans Sa-fileup.
  
4. MySQL makes PHP more exciting
The combination of PHP and MySQL is simple and exciting. PHP has many MySQL management and maintenance tools, and the most comprehensive support for mysqk. Many useful functions, such as mysql_insert_id and mysql_affected_rows, do not exist in other databases.
  
ASP and PHP are ideal solutions for medium-sized websites, but the close combination of PHP and MySQL makes PHP more advantageous.
  
MySQL is faster than Microsoft Access, and MSSQL and Oracle are faster than MySQL, but the cost is high.
  
5. Change Java and C ++ into a style
This advantage is just an opinion.
  
I know that you will not believe that a Visual Basic programmer will turn to PhP because PHP has Java and C ++ programming styles, however, you will believe that many people still like Java and C ++. PHP is a language that is easier to learn with the programming style of these two languages.
  
PHP supports structured programming. In VB, there are still few classes for its inheritance. The inheritance of PHP like Java and C ++ makes a large program full of class shadows everywhere.
  
6. Handle bugs.
Have you ever asked Microsoft to modify some asp bugs? If you are not a Boeing-like organization, you cannot quickly and appropriately modify it. If you stop working when a bug occurs, you will not be able to continue your work.
  
PHP: When you discover a bug, you can modify it. If you do not have the expert level, you can ask the experts to modify it, and your modifications will be accepted and recognized by the open code organization.
  
7. Portability
Microsoft often modifies ASP. The next version is ASP +. Now the test has started. I believe they will modify many of the issues I have mentioned before. But there is no doubt that Microsoft will limit you to the scope of their products.

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.