PHP VS ASP_php基础
PHP versus ASP
Thu, Aug 17, 2000; by John Lim.
序:
微软的ASP是一项强大的动态WEB页面技术,我已经使用了一年的ASP,用它创建了许多的WEB站点,但是现在我的公司正想转向另一项叫PHP的INTERNET技术,来进行以后的WEB站点开发。
问题是我们已经习惯于使用ASP,并且喜欢用它,为什么我们要转向PHP呢?
开放源码运动
首先,我们认识到,开源运动使我们获得了强大的技术支持和免费的代码供应。例如:在ASP中,上传文件、加密密码、发送邮件都需要第三方的商业软件的支持,是要收费的;但在PHP中,这一切是免费的!
但这还不足以说服我们转向PHP,因为我们已经投入了大量的时间和金钱在这些必需的商业软件工具上。
INTERNET程序和LINUX
我有一个梦想,我希望在将来每一个程序都是一个INTERNET程序。不用再需要购买软件包,不要再去安装它,它们能在INTERNET上得到,并且已经是安装好的,我们只要在浏览器中运行程序,这不会需要太多的配置。
大部分的网络应用程序都运行在LINUX和PHP上。它们通常不使用ASP,有一种软件叫Chilisoft ASP,它能在LINUX上运行ASP,但它是要钱的,同时它也不支持最新版的ASP,更重要的是创建高性能ASP站点所用的好的第三方DLL都不能运行在LINUX上。
于是,为了实现我们的INTERNET软件梦想,我们决定寻找一种更好的,接近于ASP的技术来替代它!
ISAPI的支持
ZEND团队正在开发的PHP核心引擎中就包括一个ISAPI引擎。
ISAPI是一种MICROSOFT的INTERNET WEBSERVER API,它的应用,使我们这些习惯于在WINDOWS下开发程序的程序员有了一条通向LINUX的捷径。
技术分析
每个人都声称自己的产品最快,这不是我真正关心的---我只关心“足够快”,对我来说,PHP足够快!
ASP支持多种程序语言。这种体系使得程序天生就带有慢和多内存占用,它的每一种语言解析就相当于一个PHP编译,(就是说,当ASP开始解析一条代码时,它相当于同时开动多个PHP),当ASP解析到一个ASP开始标记(同时,ZEND打算发布一个可以保护我们源代码的编译器,以及各种不同的优化技术(Zend Cache and Optimizer),甚至于实现PHP在WINDOWS下的良好应用,无疑,PHP在这一方面又将强于ASP!
一个使用PHP的商业决定
相对于PHP来说,这里有许多其它的开放源码选择,比如说perl,python/zope and jsp/tomact。对我来说,PHP最接近于ASP,同时也易于转换!
Perl: 一种不适用于大项目的语言.
Python/Zope:一种很好的语言,但它的体系不如PHP那般的接近ASP.
JSP/Tomcat: 我认为,比起脚本语言来,type-safe, type-bound, type-checking Java 不太好操作!
代码
我们注意到,我们用PHP开发的代码比用ASP开发的要短,这是因为,在PHP中HTTP GET和POST变量自动创建为全局变量,这样我们就不要再花费太多的时间去分析ASP REQUEST对象了。
同时PHP的include()函数非常好,我们能有条件的include代码,以使我们的代码尽量精简,更加易懂!
PHP有着相似于ASP的COOKIE和SESSION管理功能。
结论:
我现在还在使用PHP,在所有的地方使用“$”这个符号,它是非常酷的,同时它也是我最喜欢的一个符号!:)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

The enumeration function in PHP8.1 enhances the clarity and type safety of the code by defining named constants. 1) Enumerations can be integers, strings or objects, improving code readability and type safety. 2) Enumeration is based on class and supports object-oriented features such as traversal and reflection. 3) Enumeration can be used for comparison and assignment to ensure type safety. 4) Enumeration supports adding methods to implement complex logic. 5) Strict type checking and error handling can avoid common errors. 6) Enumeration reduces magic value and improves maintainability, but pay attention to performance optimization.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.
