As I have moved further into PHP programming, I'm getting a feeling as to why PHP is so popular.
I, for one, cannot see much difference between PHP and JSP except for one thing: it's PHP and not Java. Duh.
PHP does not have THE "accident" of Java, namely, needing to specify types. PHP uses dynamic typing, that is, the type depends on the context. Part of the problem here for Java is that it is not a scripting language but may need to be one for JSP.
Whereas Java was ready for the Internet when it burst on the scene some 20 years ago, PHP is ready for the web server. Super globals like $_FILE and $_POST, associative arrays, etc. -- all these things seem to make PHP more productive than Java.
JSP and servlets were after-thoughts for Java as an alternatives to Perl and CGI--or at least that's my memory of things. With garbage collection and simple inheritance, Java was definitely an advance over C++ for the tasks for which it was designed. In the same spirit, PHP seems to me an advance compared to Java for server side programming.
And I haven't even gotten to the database tie-in which I'm just about to take up in my learning.
No comments:
Post a Comment