On 2/4/2011 10:43 AM, Bryce Martin wrote:
Joe,
I appreciate your work and analysis of Java vs. PHP. And I agree, that
they both have their caveates but are largly equal to each other,
syntatically. But you can say that about any C based language.
Which makes my point: one is not easier to learn than another. It's one
of the big arguments in the IBM i community: PHP is so much easier to
learn than Java. I disagree. Except for the typing, the languages are
almost identical, it's just that Java was written that way from the
ground up, and obviously very well since PHP copied the syntax.
Sincerest form of flattery and all that. :)
Deployment, which you touch on below, is a little different.
The use of Java and PHP boils down to far more than syntax. PHP is a
scripting language where as Java is a compiled language that has to be run
in a virtual machine. This make Java (at least in my opinion) slightly
more complicated to maintain and deploy.
Interesting. What do you see as the difference between an interpreter
and a virtual machine? I realize they're different, but philosophically
they're similar. I suppose the difference is that an interpreter
magically picks up the newest version, right? That seems to be your
primary point, especially in the next paragraph...
If I want to deploy a change for
PHP I just have to plop the new script in place, but if I want to deploy
new Java code I have to restart the web server (at least in the case of
WAS and JSP's... I'm guessing this holds true with other app servers as
well for Java).
And this aimply isn't true. If you deploy a new version of a JSP to a
web server, it is automatically picked up, recompiled and ready to run.
Not only that, but the compiled bytecodes then get further compiled by
the JIT compiler to machine instructions. That makes JSP execution
lightning fast, which seems to be your other point...
Also, I know that Java has made great strides in recent years when it
comes to execution speed. But that hasn't always been the case.
It's been the case since the JIT compiler. I can build Java
applications that easily provide ten pages per second performance.
That's more than fast enough for any application I need. You?
PHP was strictly built for the web.
Sort of. PHP was written as an extension of Perl. It was to generate
HTML, not write web applications. Bit of a difference.
Java is adapted for the web.
True, to a point. Unlike PHP, Java was built from the ground up for OO
programming. This givesd it the ability to do just about anything that
requires programmatic encapsulation of strict rules - for example,
formatting HTML. But Java is more than just "adapted" for the web; the
entire Java EE framework is about nothing BUT web application
development - a framework that far surpasses anything in the PHP world.
But I digress <grin>.
Both are valid options.
Yep. So is the LDA. Which is closer to the LDA, do you think? PHP or
Java?
But when it comes to code, there are far more PHP sites out
there than Java.
Yep. Sure are. A lot more .NET than RPG. A lot more Windows boxes
than IBM i machines. There's no accounting for taste. ;)
Joe
As an Amazon Associate we earn from qualifying purchases.