PHP is much better than you think.

Source: Internet
Author: User
Tags pear drupal silex using git
PHP is much better than you think.

There are a lot of complaints about PHP, and even these complaints come from a lot of smart people. When Jeff Atwood wrote another complaining article about PHP, I thought about the good aspects of PHP.

The biggest problem with these complaints is that they come from a lot of people who are still using the old version of PHP. They may be reluctant to care or admit that PHP is evolving at a rapid pace, both at the language level and at the community level. In fact, it evolves faster than any other language or web platform. Although not always, PHP has undergone an amazing journey over the past five years.

Before we talk about the amazing achievements of the PHP community recently, let's take a look at some interesting numbers: PHP is used by 77.9% of Web sites known as the server-side programming language. WordPress is used by 16.6% of the world's websites. The highest utilization of the three CMS station system is: The first WordPress share of 54.3%, the second Joomla share of 9.2%, the third Drupal share of 6.8%. These three products are written in PHP.

PHP must have done something right, didn't it?

Now, let me tell you, PHP's stunt is that, despite all these years of change, PHP is still the easiest language to learn for non-technical people, making it possible to build dynamic websites faster than other technologies and to host websites without hassle. PHP may not be the best-designed language in the world, but it's no doubt that it allows you to do things (get things done).

PHP language

PHP5.0 (released in 2004) brings a very useful object model ... Wait, I'm talking about something that was released 8 years ago. Fast forward to the current PHP5.4, the most recent version of PHP, brings the things you dream about in the modern Web language: Yes, PHP supports namespaces (namespaces); Yes, PHP supports closures (closure); Yes, PHP supports traits.

Although it takes some time, PHP5.4 brings some syntactic sugars that make the overall experience better than ever: Yes, PHP supports defining arrays with []; Yes, PHP supports newly created objects such as calling functions: (new Foo ())->bar (); Yes, PHP supports arrays to get elements like this: $foo->bar () [1].

PHP even learns from its own mistakes: register_globals and magic_quotes have been completely erased.

PHP has a built-in Web server for local testing, which can be started at a microsecond speed.

The next challenge: How do we update the tutorials on the web that explain PHP? What is the best technology to support WebSocket in PHP programs?

PHP Eco-System

It's good to have a good language, but it's better to have a good ecosystem. In the last few years the PHP ecosystem has evolved a lot.

Git

For git I don't want to talk too much, git is used everywhere, and PHP quickly hugs git. Almost all PHP class libraries, frameworks, and products are using git, including PHP itself.

Composer

Two years ago, I wanted to get rid of the ugly pear code i hack in Symfony 1 to support plugins. Instead of a whole installation like pear, I'm trying to find the best algorithm to manage software dependencies, instead of being able to manage the dependencies of the project. I almost tried all the possibilities: From Perl to Ruby, from Debian to Redhat. The result didn't satisfy me, only my own solution happened to work ... Of course it's only my experience to talk about. Then I stumbled upon the ZYPP, which was it. ZYPP uses a Boolean gratification solution to manage dependencies. Thanks to the hard work of Nils Adermann and Jordi Boggiano, PHP now has a good management-dependent tool –composer.

Yes, PHP has a better dependency management tool than any other language.

With Git,composer, and PHP built-in Web servers, it's easier to download/test/install a PHP project.

Want to test symfony (using PHP5.4)?

 
  
  
  1. $?composer.phar?create-project?symfony/framework-standard-edition?
  2. $?cd?framework-standard-edition?
  3. $?. /app/console?server:run?

Want to test Silex?

 
  
  
  1. $?composer.phar?create-project?fabpot/silex-skeleton?
  2. $?cd?silex-skeleton?
  3. $?php?-s?localhost: 8888 ?-t?web/?

You don't know composer? You should know about it.

Browse through the main composer Warehouse Packagist, which already has more than 1900 packages, and they have been installed for millions of times in less than three months.

Next challenge: Built-in composer in the next PHP release?

Cooperation

Community cooperation is the focus of this article, and I am most proud of the place. We're starting to see better collaboration in PHP projects, and even big projects, so big that you can ignore other projects.

Phpbb,drupal,ez Publish,symfony, and many other projects (such as Phpdocumentor, PHPUnit, Behat, Zikula, Propel, Doctrine, Midgard, etc.) are sharing code. Yes, they are competitors, but they all understand that it is important to cooperate with each other. Composer is a good way to promote such cooperation.

The next challenge: persuade more projects to join the trend.

Conclusion

Let me reiterate that PHP may not be the best programming language, and I'm the first to say it's weird, but PHP is by far the best web platform.

Original link: http://hp.dewen.org/?p=1572

  • 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.