498) this.width=498; "Onmousewheel=" Javascript:return big (This) "src=" http://www.bkjia.com/uploadfile/2013/0904/ 20130904095451688.jpg "title=" 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
PHP 5.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 PHP 5.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, PHP 5.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 Arrays are supported in this way to get elements: $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)?
$ Composer.phar Create-project symfony/framework-standard-edition
$ CD Framework-standard-edition
$./app/console Server:run
Want to test Silex?
$ Composer.phar Create-project Fabpot/silex-skeleton
$ CD Silex-skeleton
$ 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.
http://www.bkjia.com/PHPjc/445653.html www.bkjia.com true http://www.bkjia.com/PHPjc/445653.html techarticle 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. ...