Advertisement

PHP is much better than you think

阅读量:

PHP has sparked numerous discussions, even among those considered knowledgeable. When Jeff Atwood contributed another critique, it prompted me to reflect on the positive aspects of PHP.

对PHP的负面评论广泛存在,并不局限于非技术人员。每当Jeff Atwood发布关于PHP的独特视角时,它总能唤起我对该语言优点的记忆。

The main issue with these comments is that they originate from individuals still trapped in PHP's outdated era. They either show no interest or refuse to acknowledge that PHP's rapid evolution—both linguistically and within its community—occurs at an alarming rate. In reality, it outpaces all other programming languages and web platforms by a significant margin. However, this situation hasn't always been true; over the past five years, PHP has experienced what can only be described as a remarkable transformation.

这些抱怨的主要缺陷在于它们仍然局限在对过去某一方面的记忆中。他们既没有意识到这一现状的存在又不愿意正视其现实意义。实际上而言,在功能水平和社区发展方面都表现突出。事实而言,在大多数情况下也是最快发展的语言之一,并非总是如此的情况。然而就过去五年而言,则是一个值得骄傲的时期。

Prior to discussing the remarkable achievements made by the PHP community recently, let us examine these impressive statistics: The PHP platform accounts for approximately 77.9% of all websites that operate on server-side languages which are widely recognized. WordPress powers around 16.6% of all global websites accessible on the internet today. When focusing on the top three Content Management Systems(CMS), WordPress emerges as the leading choice with an estimated market share of 54.3%, followed closely by Joomla at 9.2%, and Drupal rounding out the top three with approximately 6.8%. These three applications are developed using PHP technology.

在讨论 PHP 社区最近取得的显著成就之前,请参考以下相关数据:首先,在广泛使用的服务器端编程语言中有约 77.9% 的网站采用了 PHP 技术;而在全球所有类型的网站中,则有约 16.6% 是基于 WordPress(一种基于 PHP 开发的内容管理系统框架)构建的应用程序。具体而言,在 CMS 领域名列前三位的产品分别是:WordPress 在内容管理系统中的市场占有率高达 54.3%,位居榜首;紧跟其后的是 Joomla(获得第二名), Drupal 则以 6.8% 的市场份额排名第三。这些应用均为 PHP 编程语言开发而成。

Now, let me share a little secret with you about PHP's "force de tour":Even though there have been changes over time, PHP remains one of the easiest languages for non-technical users. It enables users to build dynamic websites more efficiently than other technologies. Additionally, it makes it easy and cost-effective for individuals to host their websites without encountering significant complications. While there may be better-designed languages out there, none match PHP's ability to get things done quickly and effectively.

作为一个隐藏的技巧,在可编程语言中 PHP 被认为是一种独特的存在。随着技术的发展不断演进,在非计算机专业的学习者眼中 PHP 却显得格外容易上手。这种语言不仅支持动态网站的构建,并且在开发效率方面远超其他编程语言。它的独特之处还体现在其强大的灵活性上——无论是简单的脚本编写还是复杂的 AJAX 应用开发都能游刃有余地应对。特别值得注意的是,在前端开发领域却具有不可替代的地位。然而,在 PHP 的世界里我们常常会遇到一个看似矛盾的现象:虽然它的语法结构相对简单易于理解但它所蕴含的设计理念却绝对不输给任何成熟的编程方案。这使得 PHP 成为了众多开发者实现目标的有效途径而无需多言或辩解

PHP, the Language (PHP这门语言)

PHP 5.0(发布于2004年)为我们带来了非常稳健的对象模型...不过等等,我想说的是一个已经过去了大约8年的项目。快进到现在了。最新PHP版本——PHP 5.4——配备了你所梦想的现代网页语言的各种高级功能:是的,在PHP中支持命名空间;是的,在PHP中支持闭包;是的,在PHP中支持模板。

自2004年发布以来, PHP5.0为我们提供了坚实的面向对象模型。请稍等,让我重新整理一下思路,别着急。随着时间的推移,最新的PHP版本已升级至5.4版,并增添了丰富的动态功能。这些特性可被视为构建现代Web应用的强大工具。此外,在当前版本中还新增了对命名空间的支持,并保留了原有的包机制。

It took some time,but PHP 5.4 also brought about some nice syntactic sugars that significantly enhance the overall experience.it allows for concise and intuitive array creation using square brackets.PHP provides straightforward support for invoking methods on dynamically generated objects via the syntax (new Foo())->bar().PHP offers robust functionality to retrieve indexed items from complex expressions by accessing $foo->bar()[1].

所需的时间并非短绌,然而PHP 5.4增添了一系列新的语法特性,在用户体验上带来了显著改善。确实如此,在声明数组时可采用方括号的形式;而且在创建新对象时能够调用相应的函数(例如(new Foo())->bar());此外,在处理特定表达式时也能提取出所需的数组信息。

PHP has benefited through learning from its past errors, this technology, register_globals and magic_quotes, has ceased being utilized.

PHP目前通过总结过去的经验教训来改进代码安全。然而,在当前版本中, register_globals 和 magic_quotes 这种定义已经被废弃。

Not the least, yet last, PHP includes a built-in web server application that eases local testing tasks and starts within microseconds.

在某种程度上而言,并非最不重要的地方是,在PHP中还包含一个内置的Web服务器,使其能够在本地进行测试。这个服务器启动所需的时间仅为几微秒。

Next challenges: How can we update all old tutorials about PHP on the web? What is the optimal approach to integrating WebSocket technology into a PHP application?

下一个挑战:我们如何在Web上优化所有关于PHP的旧教程?在一个PHP程序中集成WebSocket技术的最佳实践是什么?

PHP, the Ecosystem(PHP的生态系统)

A good language may be excellent, yet an outstanding ecosystem surpasses it. The PHP ecosystem has undergone significant changes over the past few years.

在一个语言体系中展现出卓越的能力是令人敬佩的成就,而形成一个规模宏大的生态系统则更能彰显其强大的生命力。随着时间推移,在过去几年里PHP生态系统的建设和发展已经取得了显著成效。

全部评论 (0)

还没有任何评论哟~