|I guess you have to write an article. But some of your items are completely contrived. |
1 ) As stated before. Just because it compiles to opcode does not make it a compiled language.
2) Threads? Not a deal breaker and there are work arounds but true threading within a web application isn't going to happen.
3) Again not a deal breaker but your method of including a other runtime is a way compensating. It not the same as have the ability to have multiple constructors. And the java solution doesn't execute java code it calls to webservices.
4 and 5 I am in complete agreement
6) I never hear of any saying that the documentation for PHP lacks. It is better than most. But hey I don't know everyone
7-8 completely aggree
9) You contradict yourself. With your point of facebook and compiling. The fact is that the scalability depends in part on the server environment. And the fact that PHP has ways of leveraging the server based scalability.
10 ) As this post shows people are asses.
PHP is a great language. But it does have warts, not genital warts but warts just the same.
|2011-08-19 01:58:42 - In reply to message 1 from jr wilbert|
|I routinely hear people say the PHP docs suck. |
|2011-08-19 06:01:12 - In reply to message 1 from jr wilbert|
|Let me comment on the points that I feel need further clarification.|
1) The PHP (Zend Engine) does contain a PHP compiler. Whether the resulting compiled code is native machine code or some virtual machine code, is irrelevant for the point I was trying to make.
People assume that interpreted languages are slow and since version 4 PHP is not slow because it compiles its code before executing. If you did not try PHP 3, I can tell you that it was 12 times slower than PHP 4 executing the same (CPU intensive) code.
That improvement was solely due to fact that PHP evolved from being interpreted during execution, to being compiled first before execution.
2) Threads mean different things to different people. If you mean a PHP script starting parallel threads, there are several solutions that you may considered to be thread based or not.
There is for instance the threads extension in PECL, which is not being developed for a while probably for the lack of interest on implementing a solution that may not be reliable in certain PHP setups that include non-thread safe extensions.
There is also the PCNTL extension that creates parallel processes, it is stable, but only run on Linux and other Unix-like OS.
For Windows there may be some solutions based on Windows specific extensions, but I do not know enough about them to comment.
Now, if you mean by threads, that PHP is thread-safe to run on a multi-threaded Web server, the core PHP engine is thread-safe. What may not be thread-safe, is some extensions or libraries that PHP may rely on to run.
3) I do not recommend either to mix PHP with other languages using the extensions mentioned in the article. But sometimes you do not have an alternative. I know for instance that some banks provide Java Jar files to integrate e-commerce sites. If your site is in PHP, you have no alternative to interface with Java.
As for Java integrating being done with Web services (servlets I suppose that is want you meant), I cannot speak of experience, but according to the PHP documentation, that is just one of the ways that the PHP Java bridge can work. The other way will start a JVM instance and everything run in-process via JNI (Java Native Interface), so I do not think it uses any Web services or RPC/RMI calls.
6) I wanted to give a few examples in the article of PHP documentation criticism, but I could not find the exact pages when I was writing the article. Now with more time, I found one example in the site Quora, but if you browse around, you will find more apparently all by PHP haters.
9) Maybe it is not clear but I did not say that scalability depends on the server environment. What I said is that scalability is not so much a matter of the language you use, but the application architecture.
There are many ways to plan your application architecture to make it scalable.
What Facebook does was not so much to make their applications scalable, but rather to reduce their costs of scaling.
If they can make their compiled PHP applications waste less RAM to handle the same number of simultaneous user per server machine, they need less server machines.
That is the greatest gain of using the Facebook HipHop compiler.
10) I agree but I would not put it explicitly in the article. It is better to let people figure out by themselves where they stand.
Finally, the article was not so much to praise PHP, but rather to clarify common misconceptions about apparent PHP limitations. We all know that PHP is not perfect. There is no perfect language.
|2011-08-19 06:54:57 - In reply to message 1 from jr wilbert|
|PHP docs - some functions are well documented - some are not. For exaple look at Reflection - in my opinion one of the most important features in php 5 - it allows you to perform loads of code generation - and what - "Warning This function is currently not documented; only its argument list is available. " - WTF??? The page for lets say: Reflection::export Last updated: Fri, 12 Aug 2011.|
But the biggest problem about PHP is that its api is a mess. Many functions have names that follow different conventions isset vs is_numeric, strpos vs str_replace for example. Some functions have strange arguments order eg.
str_replace ($search, $replace, $subject)
strtok ($str ,$token)
explode ($delimiter ,string $string)
Each time i use these functions i have to check docs because the string i'm performing operations on is the first argument for some functions or not the first argument for other.
When will php team organise all this functions into classes? PHP 7?
|2011-08-19 07:26:50 - In reply to message 4 from admin4|
|There are always parts of the documentation that it is not yet done. Usually the parts that are done are the ones that are used by the developers that have done it.|
The PHP documentation, like any other part of the PHP project is a voluntary effort.
If you go to the PHP group and complain about documentation that is missing, they will certainly invite you to become a voluntary and help doing the missing parts.
You do not get any payment besides an eventual thank you and the right to use a @php.net address if it matters to you.
As for the consistency of the order of arguments, that is a known criticism. There is not much to do about it because making the argument order more consistent would break backwards compatibility.
As for using underscores in some function names and not in other functions, that is being fixed by providing both underscored and not underscored versions as equivalent.
|2011-08-19 18:42:32 - In reply to message 3 from Manuel Lemos|
|Point 1 here again. What you are calling compiled does not mean it is a compiled language? the term compiled language refers to a language that is compiled to Machine Code, Linked and then executed.|
Please update your terminology or be very clear that it is still an Interpreted language.
|2011-08-20 09:00:26 - In reply to message 6 from Donald Duvall|
|I am afraid you are still missing the point. While you insist in being pedantic about what can be considered compiled or not, that is irrelevant.|
As I emphasized, what matters is that the way PHP execution works since PHP 4, its performance is not as slow as people imagine because they think that source code is interpreted during execution. PHP does not execute by interpreting source code. As a matter of fact, the source code may not even be present in the server, if that is important to you.