View the future of PHP from the design blueprint of ZendEngine2.0 (1 ). First of all, some miscellaneous are the original intention of this article. I have been reading the design blueprint document for ZendEngine2.0 for some time. after reading it, I was impulsive to write a comment.
Some Miscellaneous
The first is the original intention of writing this article. I have obtained the design blueprint document for Zend Engine 2.0 for some time, after reading this article, I had the urge to write a comment-because the next generation of PHP will be a language better suited to the existing object-oriented development habits, at least it is given more object-oriented features. However, the question that arises is, is it worthwhile for PHP, such a language with the initial goal of rapid Web development, to be fully qualified? This question seems to need some comments to discuss, and I am very willing to put forward my own point of view. However, after some busy things, the impulse was moved back to his stomach a little bit, and I remembered it some time ago. so I read the design blueprint document several times and read this article. (When I first got this English document, I still had the intention to translate this design blueprint document into Chinese, but considering that it was not the final blueprint, second, everyone should cultivate the habit of directly reading the original text. third, translation always inevitably brings some obscure places. However, when writing this article, I decided to translate the article "adventure" once. if you cannot reach your purpose accurately, please correct it .)
The second is the explanation of the focus of this article-in this comment, I will mainly comment on the object-oriented features that will be greatly enhanced in PHP in the future. If you are a PHP developer, I guess you should understand some object-oriented features in PHP; however, PHP is generally used in an "extremely fast development environment" (this is a word I made myself, indicating the development of customer-oriented websites, it is characterized by a very short schedule and unclear customer requirements), so there are not many developers and development projects that really use the object features in large quantities. In addition, the current PHP object model is inferior to C ++ and Java, and limits the use of this feature. However, in future PHP versions, the focus of the modification is on the object-oriented model in the language, which improves many of the bad features in the current version and adds other features. Therefore, the future of PHP is focused on the object-oriented features of PHP.
Well, let's get to the point and look at the new features of Zend Engine 2.0.
Design Blueprint for Zend Engine 2.0(Draft)
From the design blueprint (draft), we can clearly see that the next generation Zend Engine is based on the new object-oriented model. If you have used the object-oriented features of PHP 4, it may feel awkward while finding a little bit of Java or C ++-not only the lack of object-oriented syntax, and sometimes unexpected running results-all of this is caused by a less elegant object-oriented model in the existing Zend Engine 1.0 that supports PHP 4.
To put it simply, the next generation of Zend Engine will move closer to Java and draw a lot from its object-oriented model. The improved features can be divided into three types: the first type is the improvement and enhancement of the existing object-oriented model, including the definition of the builder and the destructor, added object-oriented features such as private member variables, static member variables, multi-inheritance, and overload. The second type is modification and addition and deletion of control processes, for example, a try/catch/throw violation handling mechanism is added; the third type is about function modification and addition/deletion, for example, adding a function to the string offset. (For details about each type of improvement, see the documents listed in references .) From this we can see that through the first and second types of improvement, PHP is gradually improving itself into a language with object-oriented features.
However, the problem arises exactly here:
In a positive aspect, today's programming world welcomes languages with object-oriented features (even though the language itself is not built on the object-oriented basis, you can also add defined objects to prevent the language from falling behind the trend.) -- In this sense, zend Engine 2.0 makes PHP's support for object-oriented development more consistent with the development trend of programming languages, when building enterprise-level applications (which is often accused of PHP today), using object-oriented modeling and implementation is already a de facto standard, this improvement of PHP may cater to this need and solve the weakness of the language itself in this aspect.
In the negative aspect, it seems meaningless to provide developers with a new version of PHP that is more similar to Java. The reason why PHP is widely used is that, apart from the open source code and cross-platform programming, it is also important to adapt to the simple and fast web programming features built on the Internet site. Extremely short learning time, friendly language style (especially if you are familiar with C), and a large number of extended class library functions are enough to prove its strength; however, if we transform the next version of such a language into an object-oriented language, it will not only make a large number of original developers at a loss in a short time, and it is not conducive to attracting new developers to join. since there is a language like Java, why should we study PHP?
The above are some of my "objective" analysis-the so-called "objective", which is to disguise myself as a loyal supporter of Zend Engine 2.0 when writing positive information; when writing negative information, it is the opposite (I hope you will feel objective after reading my analysis ). However, "objective" is actually only used to pave the way for my "subjective" argument --
What will PHP look like in the future?
In fact, the key to the problem may be the direction in which PHP will be expected, or the field in which PHP will be committed.
The reason why PHP is so popular, especially when there is almost no commercial support (Zend currently provides support for PHP, but it is really insignificant compared with Microsoft and Sun .) It becomes a programming language that can compete with ASP and JSP, because it is completely oriented to a realistic and fast web programming environment. This situation can be clearly seen in many PHP tutorials-to implement some common web functions, using PHP often means less code and complexity; at the same time, for programming in a specific field, PHP also has extended module functions available (although there is no commercial support, PHP has the support of a large number of open-source software advocates, they not only contributed to the generation and development of PHP, but also provided various extension module functions .), In this way, more immediately available and free function libraries mean less workload for developers. all you need to do is read the function manual and use them properly. PHP competitors seem to be somewhat "knowledgeable"-inflexible and rigorous. maybe the products of large commercial companies are less convenient to use than hackers are.
However, in order to adapt to the real Rapid web programming environment, PHP gave up some things when focusing on ease of use: for example, the developer's own module writing and encapsulation (non-source code level ), and object-oriented features (the existing version only does not fully support some of the features)-but what these PHP lacks is what their competitors possess (for example, ASP can communicate with COM components, JSP can easily use Java Bean. JSP is originated from Java, a fully object-oriented language, and so on. Therefore, PHP is usually excluded from the candidate list for building enterprise-level applications.
The core of the problem is already clear-the current development of PHP has encountered a cross-cutting Road: continue to give full play to the characteristics of your fast web programming language, or is it possible to complete and modify itself into a programming language that meets the needs of a serious business environment?1
Attention is the first intention of writing this article. I have been reading the design blueprint document for Zend Engine 2.0 for some time. after reading it, I was impulsive to write a comment-because according...