Home Backend Development PHP Tutorial 为什么开发人员对于PHP语言褒贬不一

为什么开发人员对于PHP语言褒贬不一

Jun 23, 2016 pm 01:43 PM

PHP 语言,作为服务器端开发的脚本语言,在网站开发方面非常有名。从1995年 Rasmus Lerdorf 创建之后,W3Techs 的调查显示在已知的服务端编程语言中,PHP 占了82%。其中不乏WordPress,Facebook 这种公司。

PHP 语言,作为服务器端开发的脚本语言,在网站开发方面非常有名。从1995年 Rasmus Lerdorf 创建之后,根据 W3Techs 的调查显示在已知的服务端编程语言中,PHP 占了82%。其中不乏WordPress,Facebook 这种公司。在 PyPL(编程语言流行度排行榜)中仅次于 Java,在 Toibe 排行中名列第六。2015年会有高性能的 PHP 7 发布。

像所有的技术一样,人们对它的评价参差不齐。我们来看看为什么有的人喜欢它而有的人诅咒它。

优点一:流行,容易上手

PHP 是目前最流行的编程语言。PHP 工具厂商 Zend 科技 CEO Andi Gutmans 如是说。New Media Campaigns公司的开发工程师 Josh Lockhart 对我们讲:PHP 是最容易学习的网站开发语言。它安装在绝大多数的服务器上。由于有实时更新的文档和问答,PHP 语言相对其他语言简单易学。

优点二:网站开发职位很多

Gutmans 还说,在服务器端的网站编程中PHP会帮助你找到工作。Dice.com 一个简短的调查中显示,和 PHP 相关的职位有3366个,相比于 Java 17418个和 Perl 4300个,Python 5429个少了一些,但是比 Ruby 的2973和985个 Objective-C 职位多一些。尽管比 Ruby,Python,Go,Rust 语言略逊,但是 Lockhart 认为 PHP 仍然是使用最多的语言之一。

优点三:仍然在不断发展

PHP 在不断兼容着类似 closures 和命名空间等技术,同时兼顾性能和当下流行的框架。Gutmans 说道,接触 PHP 并不需要知道 PHP 到底提供了哪些技术,Lockhart 作为一名开发人员讲:大家讲 PHP 认为是一个面向对象的开发模型。接下来的版本是7,将要提供更高性能的应用。Lockhart 指出Facebook 也在加强 PHP,比如他们的 HHVM 虚拟机,和 Hack 编程语言。

缺点:设计缺陷,缺少关注

博 主 Eevee 说,PHP 的每个功能设计都是有问题的。他对 PHP 的看法是极其糟糕的设计。Eevee 不仅不喜欢这个语言,对其框架也不能赞同。他认为 PHP 语言不稳定,总是出现各种意外。PHP 被称作是不透明的语言,因为没有堆栈追踪,各种脆弱的输入。没有一个明确的设计哲学。早期的 PHP 受到 Perl 的影响,带有 out 参数的标准库又是有 C 语言引入,面向对象的部分又是从 C++ 和Java 学来的。

Lockhart 得知 Eeveef 反对 PHP 的言论的时候他觉得有些夸张了。尽管是 PHP 的拥护者,Lockhart对于对 PHP 的批评还是很耐心的。

  • 语言不持续化,特别在命名空间和参数顺序上。Lockhart:这些都很容易适应,不是大问题。
  • PHP 还有很多遗留下来的东西,包括全局变量,魔法引用等。 Lockhart:这些不好的实现都会在不断地被淘汰。但在淘汰之前,它让变成习惯不好的程序猿有法可施。
  • PHP 的关注度不够。Lockhart 也在不断努力提升 PHP 关注度。Lockhart:尽管断断续续,但是社区的人们仍然很关注 PHP。
  • 对一门技术的喜厌程度来自很多方面,从个人习惯到项目需求,PHP没办法做到人见人爱,但是,你一定有很多话要对PHP说,那在下面的评论出说吧

    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    AI Hentai Generator

    AI Hentai Generator

    Generate AI Hentai for free.

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

    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,

    Describe the SOLID principles and how they apply to PHP development. Describe the SOLID principles and how they apply to PHP development. Apr 03, 2025 am 12:04 AM

    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 automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

    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...

    Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

    Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

    How to send a POST request containing JSON data using PHP's cURL library? How to send a POST request containing JSON data using PHP's cURL library? Apr 01, 2025 pm 03:12 PM

    Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

    Framework Security Features: Protecting against vulnerabilities. Framework Security Features: Protecting against vulnerabilities. Mar 28, 2025 pm 05:11 PM

    Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

    How to debug CLI mode in PHPStorm? How to debug CLI mode in PHPStorm? Apr 01, 2025 pm 02:57 PM

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

    See all articles