Table of Contents
PHP 语言需要避免的 10 大误区,php误区
  1. PHP是一种面向对象语言,但面向对象并不彻底
  2.PHP无法实现特定功能
  3.PHP 是不安全的
  4. 它不能适应大型应用
  5. PHP只能用于网站开发
  6.开发过程慢
  7.专业开发人员不使用PHP
  8. 性能问题
  9. 便宜没好货
  10. PHP言过其实
  结束语
Home php教程 php手册 PHP 语言需要避免的 10 大误区,php误区

PHP 语言需要避免的 10 大误区,php误区

Jun 13, 2016 am 09:19 AM
scripting language

PHP 语言需要避免的 10 大误区,php误区

  PHP是一种非常流行的开源服务器端脚本语言,你在万维网看到的大多数网站都是使用php开发的。但是,你大概很奇怪的注意到有少部分的人发誓要离php 远远的。但是令人更奇怪的是或者很震惊的说他们不用php是因为一些被证实的语言缺点。他们决定不用php,是基于误解。

  是的,你读到的那些是误解。

  让我们看看这些误解是:

  1. PHP是一种面向对象语言,但面向对象并不彻底

  这完全不对。所有认为php不是彻底面向对象的程序员,尤其是Java程序员,都需要上一个PHP的基础培训;他们会发现PHP中大量面向对象的特性。例 如:接口、方法、抽象类等等。我同意早期的PHP版本确实不支持太多面向对象的特性,但PHP5已经有强大的面向对象支持。而且,你一定想不到编码在 PHP中会变得如此简单,那是因为PHP和面向对象结合的原因。

  所以,消除这个误解吧。

  2.PHP无法实现特定功能

  我很清楚这种表述很含糊,但是我不能想出任何更好的说法。这是一个很含糊的误解,开发人员认为PHP不能帮助他们实现一些诸如内存访问的功能或者一些 PHP主要发行版没有提供支持的功能。但事实是PHP是一种可扩展的语言,所以你需要做的是用C或者C++编码,然后创建对应的扩展。

  其实,你根本不需要自己动手去创建扩展,因为这里已经有数以百计的可用扩展。你唯一需要做的就是去寻找它们。

  3.PHP 是不安全的

  开发者对PHP的另外一个误解就是PHP网站和 应用是不安全的。但是,为什么你会希望它在默认情况下是安全,为什么不编写安全的代码? 我知道这里一直存在很多不安全的PHP代码,因为最初的学习曲线是简单的而且很容易上手。所以,作为一个开发者,你需要使它尽可能的安全。

  .Net可以帮助你在默认情况下是安全的,相比之下PHP确实缺少很多。但是如果你是一个训练有素的程序员,那么你其实不要默认情况的安全帮助。Include通常是安全的,但是你需要要小心。如果它们的路径是动态生成的,对指令的透彻理解可以帮助你让代码更安全。

  4. 它不能适应大型应用

  大型复杂应用需要建立在自身可靠和高性能的语言之上,这是PHP在一定程度上所没有的。但是,如果你设计和开发的应用程序架构稳定,为什么你会对它的性能和可扩展性有疑问呢?

  事实上一些顶尖网站,如Facebook、维基百科和雅虎等等,都是基于PHP构建的,就像我们所想的那样,这些巨型网站都工作的很好。

  5. PHP只能用于网站开发

  这也是一个误解,尽管看起来它有点合乎逻辑,因为PHP是网站开发中最常见的语言。但也有一些被称为命令行界面的东西,这可以确保你的PHP应用程序可以在Web服务器之外运行。

  你可能不相信,但即使是那些很大程度上取决于CPU能力的应用程序,也可以用PHP开发的,使用PHP CLI来运行。

  更重要的是,如果你想使用PHP开发桌面应用程序,不用担心,使用Windows特定扩展你可以做到这一点。

  6.开发过程慢

  这是一直广为流传的误解。我不知道起源于何处?这个流言可能来自于曾经一个时期php代码很乱并且代码中四处充斥着Mysql语句(他们以此为反例,但是 实际上我们都不这样用)。问题是为什么这样开发过程就慢了?当大量的php框架出现时,可以大大的加速开发的过程。毋庸置疑,你可以在短时间内开发出很大 的程序,不论它有多么的复杂。所以,你用php开发一点都不慢,特别是当你使用php框架的时候。

  7.专业开发人员不使用PHP

  PHP是针对初学者的,它是为那些不是认认真真做开发的人设计的。这些说法都和PHP的使用有关。这只是一种误解,认同它没有任何意义。这里有如此多的网络应用,包括一些大型的,都是使用PHP构建的。可以想象这些说法是多么不正确。

 

  8. 性能问题

  这是一个棘手问题。这不是一个误解。和硬币有两个面一样,这个问题也是两方面的。事实上到处充斥着垃圾代码,隐式转换、不适用的模块、缺少操作符重载等等都能影响一个php应用的性能。但是这个依赖于你是不是有足够的能力去用好这个语言,用它编写稳定地、快速地应用。

  性能是由你设计的架构和你写的代码来决定的!

  9. 便宜没好货

  这条貌似在逻辑上很站得住脚,但是用到php上那就是完全是误解了!事实上,php的最大优势就是他的免费和开源,这意味着大多数提供应用开发服务的开发 者必须都精通它。虽然免费开源会带来一定问题,但是这也为了使用他们服务的客户提供成本优势。与商业开发语言相比较,php的开发成本比价低,但是这并非 意味着它的质量值得怀疑。和正确的开发者一起工作,可以获得更高性能的php应用。

  10. PHP言过其实

  真是这样么?你随口瞎说的吧。我不认为这样,还有很多的开发者也都不这样认为。

  结束语

  这不是所有php谎言的终结者。随着php语言不断的发展,变得越来与强大,误解也会跟着增长的。但请不要被他们忽悠了。多读,多问,自己动动手,然后你就知道,是不是真的了。

  英文原文:PHP Language – Top 10 Misconceptions to Avoid

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 Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Go language: a powerful and flexible scripting language Go language: a powerful and flexible scripting language Apr 08, 2024 am 09:57 AM

The Go language is a modern open source programming language known for its concurrency support, memory safety, and cross-platform compatibility. It is also an excellent scripting language, providing a rich set of built-in functions and utilities, including: Concurrency support: Simplifies scripting to perform multiple tasks simultaneously. Memory safety: The garbage collector automatically releases unused memory to prevent memory leaks. Cross-platform compatibility: Can be compiled on Windows, Linux, macOS and mobile platforms. Rich standard library: Provides common script functions such as file I/O, network requests, and regular expressions.

Is golang a scripting language? Is golang a scripting language? Jul 05, 2023 pm 02:46 PM

Golang is not a scripting language, but a static compiled language. It is a statically strongly typed, compiled, concurrent programming language with garbage collection capabilities developed by Google. Golang is developed based on the Inferno operating system.

What are the scripting languages? What are the scripting languages? Aug 10, 2023 pm 03:56 PM

Scripting languages ​​include Python, JavaScript, Ruby, Perl, Shell script, PowerShell and Lua, etc. Detailed introduction: 1. Python is a high-level scripting language that is easy to learn and has strong code readability; 2. JavaScript is a scripting language used to achieve dynamic interaction on web pages and is widely used in front-end development. ; 3. Ruby is a concise, elegant and easy-to-learn scripting language that emphasizes developer happiness and coding readability, etc.

Is Golang a scripting language or a compiled language? Analyze one by one Is Golang a scripting language or a compiled language? Analyze one by one Mar 19, 2024 pm 04:06 PM

Is Golang a scripting language or a compiled language? To analyze one by one, specific code examples are required. Golang, or Go language, is an open source programming language developed by Google. It was originally designed to solve some common problems in programming, such as concurrency, performance, etc. During the development process, there is often some debate about whether Golang is a scripting language or a compiled language. In order to solve this problem, we need to first understand the definitions of scripting language and compiled language, and then conduct a detailed analysis based on the characteristics of Golang.

Five interesting Python scripts Five interesting Python scripts Apr 12, 2023 am 09:10 AM

Python can be used in many directions, such as crawlers, predictive analysis, GUI, automation, image processing, visualization, etc. It may only take a dozen lines of code to achieve cool functions. Because Python is a dynamic scripting language, the code logic is much simpler than Java, and a lot less code is needed to achieve the same function. Moreover, the Python ecosystem has many third-party tool libraries that encapsulate functions in packages. You only need to call the interface to use complex functions. Here are a few simple and fun script examples. Beginners can follow the code and quickly master python syntax. 1. Use PIL, Matplotlib, and Numpy to repair blurry old photos and import numpy

What are the characteristics of scripting language What are the characteristics of scripting language Jan 02, 2021 pm 04:34 PM

Characteristics of scripting language: 1. Scripting language is between HTML and C, C++, Java, C# and other programming languages; 2. Scripting language is composed of program code; 3. Scripting language is an interpreted language and does not require compilation. It can be used directly, and the interpreter is responsible for the interpretation; 4. Scripting languages ​​generally exist in text form; 5. Simple, easy to learn, and easy to use.

Explore the advantages of Go as a scripting language Explore the advantages of Go as a scripting language Apr 07, 2024 pm 02:24 PM

The Go language is an ideal choice for writing scripts due to its concurrency, cross-platform nature, static type system, and built-in package manager. It is easy to write, fast to execute, resource efficient, and provides a powerful toolset to make scripting more convenient.

Is Golang considered a scripting language? Discussion and analysis Is Golang considered a scripting language? Discussion and analysis Mar 19, 2024 am 11:12 AM

Is Golang considered a scripting language? Discussion and Analysis In recent years, Golang (Go language), as an emerging programming language, has attracted much attention in the industry. Its emergence has excited many developers, who strive to improve development efficiency with its fast, efficient and easy-to-understand features. However, while many people praise its powerful functions, some people also dispute its positioning: Is Golang considered a scripting language? This issue not only caused some discussions in the technical field, but also related to the essence of Golang.

See all articles