Four ways to make PHP coding easier _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Tags hhvm javascript extension pear php software
PHP encoding can be made easier in four ways. Four methods to make PHP coding easier Bkjia Selected Translations] Although PHP has already established its own software culture, however, to find its maddening drawbacks, PHP coding can be made easier in four ways.

Bkjia: Although the PHP language has already established its own software culture, it is absolutely not difficult to find out its crazy drawbacks. We used to list the twelve worst features that were the most unacceptable to developers in our previous articles.

However, over the past few years, PHP has undergone a series of changes-from the language itself to the relevant ecosystem, to the support for the developer community-which deserves our attention. Although users who have abandoned PHP and devoted themselves to Python or Ruby are unlikely to be attracted in a short time, there are already signs that someone is trying to improve PHP. Next, let's take a look at four major improvements to the PHP language.

1. software packages and dependency management

Not long ago, the only way to manage PHP software packages was to use PEAR (PHP extension and application library ). However, PEAR has been attacked by developers for a long time in terms of ease of use, which is filled with a large number of outdated and unmaintained software components. Most of the more popular PHP frameworks have their own unique software package management systems-such as CakePHP's Bakery and CodeIgniter's Sparks-but they have little or no way to take care of PHP as a whole.

The biggest change in this regard stems from Composer, which draws on the excellent elements of Node. js's NPM system and Ruby's Bundler. It tracks software packages based on projects so that developers can easily figure out which software packages need to be used for a specific project and install them in an automated manner. It works with a library named Packagist, which contains a large number of common PHP applications, frameworks, and components.

2. Hack/HHVM

The other two most significant changes made by PHP come from outside of the PHP System-more accurately, from Facebook: the Hack language and HHVM, namely, the HipHop Virtual Machine ). The former inherits from PHP and adds a series of functions that cannot be implemented by default in PHP, such as static object type. The latter can compile PHP code into C ++ code to speed up its execution, and eventually bring about nearly ten times the original performance level. Both of them are relatively short-term innovations, so their long-term impact on PHP remains to be observed. However, they at least show that the mainstream Web service giants are indeed interested in and take PHP seriously, and therefore use it as their own platform solution.

3. PHP-FIG

Although it sounds like a small snack, Fig indicates figs), it is actually a PHP Framework Program group, it summarizes the technical achievements created by PHP developers for building development standards, including how to develop your own projects in a consistent manner. Technicians from CakePHP, Drupal, Joomla, SugarCRM and other projects have officially joined the group, it also provides a standardized mechanism for many daily work items, including coding style guides, database logon interfaces, and how to handle automatic loading of classes.

This group can be said to be completely voluntary and informal, but they hope that "over time, its coverage will be extended to a wider range of project divisions ."

4. Phpng project

Developing a new version for the PHP language ontology is another excellent idea that brings comprehensive improvements to the language. This PHP development branch, known as Phpng, contains many improvements to specify the memory capacity required for a specific operation and the number of machine commands required to complete a specific running effect. Most of the work is sponsored by Zend technology, a PHP vendor, which is widely used in commercial installation of the language.

Of course, most of these improvements only aim to improve its performance, rather than changing the ironic syntax features of the PHP language-unfortunately, these problems are still not yet resolved. Maybe the next major reform of PHP won't be as disruptive as the Hack, but more like a conversion language that can achieve Native compilation in the JavaScript extension solution.

Http://www.infoworld.com/t/php-web/4-ways-php-coding-getting-less-painful-245435.

Although the PHP language has already established its own software culture, it is absolutely necessary to find out its crazy disadvantages...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.