search
HomeBackend DevelopmentPHP TutorialWhy is PHP a concentration camp_PHP Tutorial

This article is translated from the article Why PHP Was a Ghetto.

One day I was chatting with the boss of a great startup company in DUMBO and talked about why developers in the non-PHP world generally despise PHP and PHP-related communities. He made a point that stuck with me, largely because I had never heard it made like this before.

If you don’t know what complaints most programmers have about PHP, then these complaints would look something like this:

Ugly syntax

Lacks some necessary features that other languages ​​have (before version 5.3, no namespaces, closures)

Inconsistent function naming, usage conventions, and other weird stuff

A mixture of procedural and object-oriented

Basically 80-90% of PHP projects suck like a pile of shit

But the problem with PHP he mentioned is another problem. He doesn't say there's something wrong with the language - he thinks the language is surrounded by a common cultural phenomenon, a cultural tradition usually created by the creators of the language, which now seems to be responsible for some bad programming practices. The method played an encouraging role. That is, it makes PHP code inferior and unmaintainable.

This phenomenon of a language or framework that embodies the founder’s philosophical thoughts and is highly praised by the relevant community does exist. He cited Ruby and its founder Matz as examples. What Matz wanted was a language that was easy to read and write and could improve programmers' work efficiency. Don’t you see how Ruby developers talk about rapid development and the elegance of the language?

Then there is DHH and his Rails framework. And Guido and his Python language. So I was thinking: RasmusWhat about PHP?

Rasmus Lerdorf’s impression is very interesting. He created the original PHP language and has been improving the language. He is worshiped like a god in the PHP community and he enjoys the greatest authority in any aspect of PHP. He was invited to speak at numerous conferences and was hired by a large Internet company (yahoo.com), where he gained everyone's respect - despite the fact that he became the target of most non-PHP programmers. A visual representation of the many problems that despise PHP.

Rasmus advocates avoiding the use of frameworks and treating PHP more as a template language. To him, this approach yields immediate operational efficiency and scalability (the program load is known). For everyone else, this approach resulted in a simmering mess of procedural code and an unmaintainable project. In the approximately 10 years since PHP was born in 1995, all PHP projects have been written according to this guidance.

At the same time, another problem suddenly appeared: before PHP5.0, in the early days of PHP, PHP gained a large number of novice followers. The barrier to entry for this language is surprisingly low. Anyone can download the self-extracting ×AMP Windows program installation package and start using the language within 2 minutes. In addition, there was no real consensus on the MVC pattern in web development methods at that time. So you can imagine what a group of novices can create when they come together with a language that lacks good development practices. An unmaintainable pile of garbage. And the entire environment is like this.

Don't get me wrong - there were still a lot of good PHP developers, even back then. But, like I said, shoddy rookie work is everywhere. When cowboy-style PHP programmers got together to develop programs without guiding principles, the likes of PHPbb, PHPNuke, and many crude .php3 packages emerged. But can you simply blame PHP developers? cannot! Other Web language giants, ASP and Perl, are equally notorious and promote a stew-style development approach.

So this is why PHP gets such a bad rap. It's because of its historical spread. Most PHP developers who had moved to Python, Ruby, and Java did not go back and rethink the language when the MVC concept emerged. In addition, there are some explicit satires like "Ruby boy" Zed Shaw complaining that some programmers' minds are "poisoned by PHP". Comments like this are very popular on RubyInside.

PHP is a concentration camp

But the emergence of frameworks like Zend and CodeIgniter has pushed the language in the right development direction. In fact, it pushed PHP in the opposite direction from what Rasmus wanted to see. Take a look at the Zend and CodeIgniter frameworks, and you will find that they are one of the few programs with well-written documentation and well-written code.

Most developers who learn Ruby also learn Rails and MVC knowledge; PHP has been used for a full 10 years before this. For those who are new to Ruby, it's a shame that Ruby doesn't give them this time to play freely. Rails has ready-made standard guidance, and its entry barrier is relatively high, which usually blocks out some inexperienced developers.

In fact, PHP applications can be written as well as other languages, and they will also have certain advantages in running speed. The rise of the MVC-style development method in the PHP world has only appeared in recent years. We have to admit that we should be grateful to Rails for bringing this change.

So, what does PHP look like today?

Various standards (not unified, but most projects use MVC, few junk procedural programs)

Low entry barrier

Speed ​​and scalability (PHP should be the best among various scripting languages)

Have a good unit testing framework

Have the best documents translated into various languages

In addition, most influential websites on the Internet use PHP as their backend language or tool, such as Facebook, Digg, Wikipedia, WordPress, Drupal, etc. I believe that having an in-depth mastery of PHP will open the door to more unknown areas for a programmer.

If you don’t agree with what’s said above, please leave a comment or email me – I’d like to hear why you don’t think so.

In fact, I am not a PHP fan, I have no feeling for the language. I mostly use PHP because - you guessed it - someone is willing to pay me. So blame it all on this:

If you want to make informed decisions in software design, PHP is your best choice for developing web applications.

By the way, if you are convinced that you want to use PHP to develop your next web application, give CodeIgniter a try. It is a lightweight, plain and super fast PHP framework. I'm a fan of CodeIgniter.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371713.htmlTechArticleThis article is translated from the article Why PHP Was a Ghetto. One day I was chatting with the owner of a great startup in DUMBO and talked about why developers in the non-PHP world generally...
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
为什么wallpaper engine一直在更新为什么wallpaper engine一直在更新Mar 15, 2024 pm 07:10 PM

用户在使用wallpaperengine时可以下载各种不同类型的壁纸,有很多用户不知道为什么wallpaperengine一直在更新,它是一款创意制作软件,软件中需要时刻更新最新的工具以及素材。为什么wallpaperengine一直在更新1、WallpaperEngine每次使用时都要进行更新,这是正常现象。2、WallpaperEngine是一款创意制作软件,软件中需要时刻更新最新的工具以及素材。3、每次使用都要更新,但更新文件包并不大,更新速度很快。4、订阅的壁纸只要有一个有更新他就跟着更

SUPRA币2025年会暴涨吗SUPRA币2025年会暴涨吗Dec 09, 2024 pm 12:14 PM

这篇分析报告探讨了 SUPRA 币在 2025 年的潜在增长潜力,识别了影响其价值的潜在市场因素、技术发展和监管变化。该报告评估了 OKX 生态系统的扩展、DeFi 行业的增长、机构投资、技术创新和监管环境改善等因素,这些因素可能会在未来几年推动 SUPRA 币的上涨。报告还考虑了潜在的下跌因素,包括市场竞争、监管风险、技术问题、市场情绪和经济衰退。

币圈跨链桥重要么 简单通俗解释什么是跨连桥币圈跨链桥重要么 简单通俗解释什么是跨连桥Dec 19, 2024 pm 02:45 PM

币圈犹如独立岛屿组成的世界,每个区块链(岛屿)拥有独特货币和规则。跨链桥就像一座连接岛屿的桥梁,让用户可以安全地跨链转移代币。它提升了互操作性,促进了价值流动,拓展了应用场景,甚至可以提升效率。不过,跨链桥也存在安全、中心化和技术复杂性等风险,选择信誉良好的跨链桥至关重要。通过跨链桥,币圈得以构建一个更加互联互通的区块链新世界。

为什么笔记本电脑能够使用充电宝作为电源?为什么笔记本电脑能够使用充电宝作为电源?Jan 15, 2024 pm 06:54 PM

笔记本可以用充电宝供电吗由于笔记本电脑的电池电压、充电电流以及充电接口与充电宝不一致,因此无法使用充电宝给笔记本电脑充电。这是由于技术规格的差异导致的。充电宝通常的输出电压是5V或者5.2V。而笔记本电脑的充电电压要求至少为13.5V,有些甚至需要更高的电压,如19.5V或者20V,才能正常充电。所以,如果想要用充电宝给笔记本电脑充电,需要确保充电宝能够提供足够的电压。当笔记本电脑充电时,通常需要3A以上的电流。然而,充电宝的标称电流只有2.1A。现在市面上的笔记本电脑都使用圆型接口,不同厂家的

私募币都要锁仓吗?为什么?私募币都要锁仓吗?为什么?Jun 25, 2024 pm 07:57 PM

锁仓是一种常见的机制,私募币锁仓也是市场上常见的一个策略,指将一定数量的代币锁定在特定的钱包地址或智能合约中,使其在一段时间内无法自由交易或转移。作为投资者可能会好奇是不是市场上的私募币都要锁仓吗?通常来说是要锁仓的,有的投资者就会疑惑为什么私募币都要锁仓?就资料分析来看,锁仓的目的通常是为了促进项目的长期发展,增加代币的价值,同时显示项目方的承诺和信心。接下来小编为大家详细说说这个问题。私募币都要锁仓吗?私募币都要锁仓,私募币锁仓就是投资者在购买私募代币后,需要在一定时期内不得出售或转移这些代

比特币发行至今价格一览 历年最高和最低价分别是多少比特币发行至今价格一览 历年最高和最低价分别是多少Dec 14, 2024 am 06:17 AM

比特币自 2009 年发行以来经历了剧烈的价格波动,从 2011 年的 2.01 美元低点飙升至 2021 年的 68,000 美元高点。价格波动受供需关系、监管政策、经济状况和技术创新等因素影响。例如,2017 年,由于需求激增,比特币价格飙升至近 20,000 美元,而 2022 年,美联储收紧货币政策导致价格大幅下跌。

ai用混合工具有锯齿ai用混合工具有锯齿Nov 28, 2024 pm 08:24 PM

AI混合工具边缘锯齿的原因包括:低图像分辨率、小羽化半径、锋利边缘、算法限制、抗锯齿设置、混合模式和图像噪点。

BTC币上线了哪些交易所_BTC币在哪些交易所上架了BTC币上线了哪些交易所_BTC币在哪些交易所上架了Jan 10, 2025 pm 12:41 PM

本文介绍了 BTC 币上线的知名交易所,并提供了详细的分步指南,指导读者如何购买和交易 BTC 币。列出的交易所包括 OKX、币安、火币、Coinbase 和 Kraken,每家交易所都提供了独特的平台功能。指南涵盖账户创建、入金、购买 BTC 币和安全存储等关键步骤。本文还讨论了选择交易所的因素,以及确保 BTC 币安全性的最佳实践。通过遵循本文中的说明,读者可以轻松开始使用 BTC 币的交易和投资。

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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.