I don't think your argument that PHP isn't an OO language is a good one. I
agree that it isn't a purist OO language, but I actually enjoy the middle
ground of OO it found and actually wish RPG could find similar middle
ground. You don't need OO to develop business apps, you just need a modular
language. On the flipside, OO is great for low level framework building and
what not.

IMO a bigger issue would be strong typing for variables. That has bitten me
in the butt a number of times and I would have to believe it would be hard
to catch errors at development time in PHP as good as Java can catch them in
the IDE.

Yes, it's a learning curve. But if you learned subfiles you can learn
Java.

I haven't done subfiles for awhile, but I would consider the above statement
grossly inaccurate. Remember we are talking about building applications
that have many different configuration files and many different jars, and
many different layers that all need to work together - no just the Java
language and syntax. Like others have said before, it is easy for you Joe
because you have lived in the space for so long. In contrast, PHP is easier
than doing RPG CGI in some cases. Both of those statements are leading me
up to ask you if you've tried grails.org's framework for Java. I think the
Java community/creators are finally realizing that the language, to gain
broad acceptance, needs less of a scholarly approach and more of a get'er
done approach - which I believe grails.org is attempting to do.

PHP came from humble beginnings and is _still_ learning about enterprise,
and that makes it a risky venture. I would say one takes the same risk with
Microsoft/IIS/ASP.NET, but that's a battle for another day.

Aaron Bartell
http://mowyourlawn.com


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Joe Pluta
Sent: Tuesday, September 25, 2007 12:12 AM
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: A Dialogue

From: Jon Paris

>> Research over the past few days indicates few viable options are
available to meet this objective. One of those options is programming
in Java.

I would also seriously look at PHP. It appears to perform better on
the i than Java and is as ubiquitous in terms of multi-platform as you can
get.

IMHO, Java and PHP have different purposes.

If you want to build a simple web application that doesn't require a lot of
back end processing, then PHP is the way to go. Simple, easy, fast. Sort
of like BASIC for the web.

If you want a commercial-grade web application framework, then Java wins
hands down for a number of reasons. First and foremost, it's a real
language. It's designed to run outside the browser as well as inside the
browser.

Second, Java has a robust set of standards-based APIs. PHP's user community
is perhaps the largest such group out there, but there is no real
standardization. As an example, the functions used to access the MySQL
database have different names than those used to access DB2. In PHP 5.1,
the PHP Data Objects concept was introduced which brought PHP perhaps level
with JDBC from a consistency standpoint, but lots of older code doesn't use
PDO syntax.

Third, for a project of any size, OO requires the use of namespaces. PHP5
added OO but not namespaces. Those of you who have tried to use service
programs in RPG know just how horrible a lack of namespaces really is.

There are other issues that make Java more of a commercial grade language
than PHP, ranging from character code support to 64-bit integers. There are
some rather nasty holes in the OO model (e.g., you can't override static
methods). All-in-all, PHP is really not an OO language, it's a scripting
language with OO bolted on.

On the other side of the coin, PHP makes it easy to hack together 'Hello
World' scripts, and you don't have to "learn" anything. Java takes time to
jump the learning curve. And prior to PHP5, I'd be able to point to the
fact that there really wasn't anything to learn with PHP; it really was a
hacker language.

PHP has advanced considerably, and PHP5 is especially mature compared to the
prior releases. However, this does add to the decision points you have to
make before even starting a PHP project. For example, as I noted above you
have to learn the idiosyncrasies of the database you choose (and you'll need
to add more any time you add a new database) or else you'll have to commit
to PHP Data objects (or the proprietary Zend_db routines). Next you have to
decide whether you're going to use OO or not, and learning PHP's OO syntax
is not exactly simple. And you'll have to decide whether you want to use
PHP5 exception handling or the older PHP4 technique (with the rather
quaintly named "die" opcode).

And since the overwhelming majority of the open source code out there is
written to PHP4 (or before!), if you plan to use PHP5 you're not going to be
able to incorporate the older code, unless consistent coding standards
aren't important. At least PHP5 runs PHP4 code (with some exceptions);
however, it's not necessarily true that PHP6 will be backwards compatible
with either 5 or 4.

I could go on and on, but what does it come down to?

If you need to quickly knock together scripts that aren't particularly
robust and don't need standardization, then PHP is a great tool. Like Perl
before it, and ColdFusion, and JSP Model 1, a tightly coupled web scripting
language makes the UI portion of web development relatively easy.

If, however, you want a robust standards-based language with a cohesive
framework that is designed for application development, then Java is
probably a better bet. Yes, it's a learning curve. But if you learned
subfiles you can learn Java. Fire up WDSC and take one of the Java
tutorials to get started.

Joe



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.