Why is it that PHP is a concentration camp?

Source: Internet
Author: User
Tags php framework codeigniter
Why is it that PHP is a concentration camp?

One day I was chatting with the boss of a great startup in DUMBO about why developers in non-PHP circles generally despise PHP and PHP-related communities. He made an impression that I was very impressed, largely because I had never heard of such an argument before.

If you don't know what most programmers would complain about PHP, these complaints would be almost like this:

    1. Ugly grammar
    2. Lack of necessary features in other languages (prior to 5.3, no namespaces, closures)
    3. Inconsistent function naming, usage conventions, and some other weird stuff.
    4. Process and object-oriented miscellaneous blending
    5. Basically, 80-90% 's PHP project is rotten to a heap of crap.

But what he says about PHP is another problem. He did not say that there was a problem with the language-he believed that the language was surrounded by a common cultural phenomenon, a cultural tradition that was often created by the creator of the language, and now seems to encourage some bad programming practices. That is, it makes PHP code poor and non-maintainable.

It is true that a language or framework is a phenomenon in which the founders ' philosophical thoughts are respected by the relevant community. He took out Ruby and its founder Matz as an example. What Matz wants is a language that is easy to read and write, which improves programmer productivity. Don't see what Ruby developers say about rapid development and the elegance of this language?

And then there's DHH? and his rails framework. There are also Guido and his Python language. So I was thinking:Rasmus for PHP?

The impression of Rasmus Lerdorf is very interesting. He created the original version of the PHP language, and has been improving the language, he is in the PHP community as God as the worship, he in any aspect of PHP enjoys the greatest authority. He was invited by a number of conferences to give speeches, and he was hired by big internet companies , and he gained all respect-despite the fact that he became the image of most of the problems that non-PHP programmers despise in PHP.

Rasmus advocates avoiding the use of frames and using PHP more as a template language. For him, this approach can produce direct operational efficiency and scalability (known as program load). For everyone else, this has resulted in a lot of stew-like procedural code and a lot of items that can't be maintained. Since PHP was born in 1995, about 10 years ago, all of the PHP projects have been written in this direction.

At the same time another problem suddenly arose: before PHP5.0, PHP had a lot of novice followers in the early days of PHP. The entry threshold for this language is surprisingly low, and anyone can download the self-extracting Xamp Windows Installer package and use the language in 2 two minutes. Beyond that, the consensus on the MVC pattern in web development was not really there. So you can imagine a group of novices and a language that lacks good development practices to be able to create what? A heap of rubbish that cannot be maintained. And the whole big environment is like this.

Don't get me wrong--good PHP developers are still a lot, even at the time. But, as I said, the shoddy rookie works are everywhere. When the cowboy-free PHP programmer gathers together to develop the program without guidelines, it appears as phpBB, Phpnuke, and a lot of rough. PHP3 packages. But can you simply blame the PHP developer? No! Other Web language giants, ASPs and Perl, are also notorious for developing a style of stew.

So that's why PHP gets such a stigma. is because of its historical spread. Most of the year's PHP developers who have turned to Python,ruby and Java have not gone back to rethinking the language when the concept of MVC arose on the web. In addition, there are some like "Ruby Childe" Zed Shaw complained that some programmers thinking "by PHP poison" such an explicit irony, such comments are prevalent in the Rubyinside .

PHP is a concentration camp.

But the advent of frameworks like Zend and CodeIgniter has pushed the language to the right direction of development. In fact, it pushes PHP in the opposite direction as Rasmus would like to see. Looking at the Zend and CodeIgniter frameworks, you will find that they are a few of the documents written very well and the code is written in a very good program.

Most of the Ruby developers are learning about rails and MVC, and PHP has been used for a full 10 years. For the novice, The Hateful Ruby did not give them the time to let them play freely. Rails has standard guidelines, which are relatively high-entry thresholds, often blocking out the door for inexperienced developers.

In fact, PHP applications can be written in other languages as well, and will have a certain speed advantage. The development of the MVC style in the PHP world has arisen only in recent years. Admittedly, we should thank rails for this change.

So, what is PHP like now?

    1. Various standards (non-uniform, but most projects use MVC, few garbage-like procedural procedures)
    2. Very low entry threshold
    3. Speed and Scalability (PHP should be the best in a variety of scripting languages)
    4. Have a good unit testing framework
    5. Documents with the best translations of national languages

In addition, most influential websites on the internet use PHP as their back-Office language or tool, such as Facebook,digg, Wikipedia, Wordpress,drupal and so on. I believe that having a deep grasp of PHP will enable a programmer to open the door to more unknown areas.

If you disagree with the above, please leave a comment or email me-I want to hear why you don't think so.

In fact, I am not a PHP fan, I have no sense of language. I use PHP mostly because--you guessed it--someone is willing to pay me. So it's all attributed to this:

If you want to make an informed decision on software design, PHP is the best choice for you to develop a Web application.

By the way, if you're sure you want to use PHP to develop your next Web app, try codeigniter. It is a lightweight, generic, super fast PHP framework. For CodeIgniter, I'm a fan.

?

:)

1/F Zjshan 2011-05-13

2/F Lvhjean 2011-05-13

Not bad.
I also like CodeIgniter, is currently studying.

3/F Tyler_long 2011-05-14

PHP has used the Symfony framework. It can be said that the framework is no less well known than Codigniter and Zend. But the whole process I suffered a painful ordeal. Feel very confused, write out the code in a few days can not see. Two months I've been tossing a little project that's not much more complicated than a simple blogging program.

Feel the disadvantage of a language, the frame is difficult to compensate. So now we are very determined to follow Python and C #. Both are very elegant and can be used almost on different occasions. IronPython and C # can call each other! When I know this, the excitement is hard to say. You say, C # and Python, what projects do not come out? What other projects are hard to do?

So say, PHP framework fans, the abyss of misery, rebuild ... There's something better than PHP, and it's a lot more.

4/F Cherrycmd 2011-05-15

PHP projects are difficult to maintain

5/F Smartfish9 2011-05-15

Tyler_long wrote

PHP has used the Symfony framework. It can be said that the framework is no less well known than Codigniter and Zend. But the whole process I suffered a painful ordeal. Feel very confused, write out the code in a few days can not see. Two months I've been tossing a little project that's not much more complicated than a simple blogging program.

Feel the disadvantage of a language, the frame is difficult to compensate. So now we are very determined to follow Python and C #. Both are very elegant and can be used almost on different occasions. IronPython and C # can call each other! When I know this, the excitement is hard to say. You say, C # and Python, what projects do not come out? What other projects are hard to do?

So say, PHP framework fans, the abyss of misery, rebuild ... There's something better than PHP, and it's a lot more.


The Symfony framework is very bad. Now the frame I feel still is yii good, codeigniter useless, but compared with yii, speed is very slow, zendframework speed is slower, and excessive design, seriously not recommended. I'm familiar with Python, and Django, I feel like a site or PHP, of course, first of all, choose a good framework, and take some time to learn it.

6/F Xieye 2011-05-17

With Zend for many years, the Zend feature is that if you are not satisfied with one of the packages, you don't have to. You can only pick the one you love.

7/F Bardo 2011-06-06

I can't agree with the blogger's view completely. The main reason is the approval of the framework. PHP does not have a good framework. Zend, I have made a critique on this website. As for CodeIgniter, it is a toy at best. What it can do is just a small corporate website, and there are quite a few problems with security, extensibility, and so on, including the Kohana that are rewritten on its basis.
PHP's biggest sorrow now is that there is no good frame. There are some things that are standard. For example: log4php, that is copied Java. CAKE, that's the ror of the copy. Sadly, the person who copied it, the root is not not proficient in PHP. So, it's rubbish.

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