search
HomeBackend DevelopmentPHP Tutorial看到有人说 PHP 是个垃圾语言,建议学习 Node.js、Python、Java,此话怎讲?

鄙人是个PHP的新手,买了java的手册还没开始看·这个说法让鄙人很受刺激,真心希望了解具体情况。

回复内容:

"Father, forgive them for they don't know what they're doing(saying) ... " - Jesus 你学你的,和其他人有关系吗?看书吧,孩子 此话纯属胡扯。不必纠结。 baidu.com/index.php,不多说 php入门简单,因为别的语言在写之前都需要调一个web框架,web框架会启动一个用相应语言写的web服务器,这个服务器的所有行为都是你可以控制的。
php不同,它其实本身就是一个web框架,它会运行在已有的web服务器上,在正式运行你的脚本前,它会帮你做很多事情(比如处理get,post参数啊之类的)

对于新手来说,其实你不需要知道这么多细节,你放一个php文件在文件夹里,在你访问这个文件对应的url的时候,php会自动帮你运行这个php脚本。所以你可以省去做很多工作。

对于网站来说,php提供的一切都很完美(这么多大公司在用),你完全不需要考虑底层的东西,集中精力搞应用层吧。

当你的编程经验达到一定程度的时候,你觉得自己想写一个web服务器(类似apache那样),php肯定做不了,这时候nodejs,python,java就可以做这样的事情。

网站除了后台,还有前端,这时候你就得学js,学了js你就发现还有nodejs可以学,然后你发现nodejs好强大,几行代码就能实现一个实时的应用程序,分分钟变成了全端工程师。

扯了这么多,我的建议是先学php,很多编程的技巧,经验都是想通的,再学js,其他语言看兴趣,java也不是太难,就是写起来比较繁琐。 首先,各种语言都有不同的特性,对应不同的应用环境有各自的优点和缺点。
对于某个具体的环境只有合适或者不合适的差别——表现在性能、开发效率、代码质量控制、兼容性、部署、维护、社区技术支持、框架、更新维护以及人力成本、基础设施要求等非常多的方面。
以垃圾来概括某种语言既是认为此种语言一无是处,这是缺乏事实依据的。很多唯性能论者和以某种语言来抬高自己身价的人经常会有这种言论。


我对楼主的建议:
1. PHP是一门很流行的语言,而且也在不断改进着。虽然由于其特性,在运行效率上不及某几种语言,但它的入门难度几乎是最低的(但想做到精通的话难度不下于任何一门语言),同时它的部署和维护难度也很低,有大量的开源项目和框架、社区支持

2. 做为一个有追求的开发者,不要把自己绑死在一种语言上。你的标题至少后半句是正确的:在学好一门语言的基础上,对网络/软件开发会有更深层的认识,求知欲会让你不满足于现状,学更多的东西去开阔眼界,弥补现在的不足。但切记学什么都要扎实,而不是为了向别人炫耀。作为一个谦逊的程序员,要时刻记得自己是站在巨人的肩膀上的,语言再牛逼,你也只是会使用的人而已。

这点事情就让你受刺激啊 你也太容易受刺激了 不要相信他胡扯 语言的优劣怎么能用垃圾这个词 Facebook是用PHP写的 说实话,这个是php的历史造成的

php现在是垃圾语言吗?当然不是,wordpress,drupal,eyeos,那个不是顶级的应用,那么关于php的成见何时开始的呢

在php4.0的时代,php有着很严重的问题,不支持面向对象,性能很差,同样因为不支持面向对象,很多逻辑的实现用代码写起来很不优雅,究其原因,php一开始的目标并不像java之类的语言那样远大,只是在web领域内做一个细分而已,嵌入HTML语句和内容的更新.这些使得php入门非常容易,但也更使计算机的专业人士看不上这种语言.
这儿找到一个关于php发展历史的文章 swoole.com/PHP.html

但恰恰因为php的简单,使得其安装,部署非常的方便,又只在web方面做优化,成为专门领域的语言,当web流行起来的时候,php也快速发展着,成为web语言里的强者

当一门语言流行后,这个语言的发展就会非常迅速,在php到5.0后,已经是一个里程碑,和之前已经完全不同,但之前的名声大大影响的现在的php,可以想象,php能够撑起全球最大的社交网站,其本身已经非常完善,性能也已经有了很大的提高,之前看过一个关于脚本语言的评测,php的性能已经在所有脚本里面能够属一属二了.

很多人批判php的语法,这个我觉得见仁见智,php沿用的C的语法,几乎没有改变,本身并不算差,主要是php的系统函数命名规范不一致,还有其他一些方面的原因,但这个不能妨碍php成为优秀语言的原因

如果你觉得php性能不够,用facebook的hithop编译下,用C++扩展,作为一门专业领域的语言,是很强大的,另外,对提问者说这些话的人,基本上都是道听途说,以讹传讹的 说这话的人都是浮躁的人,与其听别人这样说,不如去在实践中体会。 php设计哲学是包容性。开发效率完爆各种语言!因为他们要被php取代了,在公司没地位了,要失业了,所以恐慌了。说php效率的,一般在数据库的效率,mysql就这样。不用强加别人
Statement
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
PHP in Action: Real-World Examples and ApplicationsPHP in Action: Real-World Examples and ApplicationsApr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP: Creating Interactive Web Content with EasePHP: Creating Interactive Web Content with EaseApr 14, 2025 am 12:15 AM

PHP makes it easy to create interactive web content. 1) Dynamically generate content by embedding HTML and display it in real time based on user input or database data. 2) Process form submission and generate dynamic output to ensure that htmlspecialchars is used to prevent XSS. 3) Use MySQL to create a user registration system, and use password_hash and preprocessing statements to enhance security. Mastering these techniques will improve the efficiency of web development.

PHP and Python: Comparing Two Popular Programming LanguagesPHP and Python: Comparing Two Popular Programming LanguagesApr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

The Enduring Relevance of PHP: Is It Still Alive?The Enduring Relevance of PHP: Is It Still Alive?Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP's Current Status: A Look at Web Development TrendsPHP's Current Status: A Look at Web Development TrendsApr 13, 2025 am 12:20 AM

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

PHP vs. Other Languages: A ComparisonPHP vs. Other Languages: A ComparisonApr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP vs. Python: Core Features and FunctionalityPHP vs. Python: Core Features and FunctionalityApr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

PHP: A Key Language for Web DevelopmentPHP: A Key Language for Web DevelopmentApr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

See all articles

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 agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft