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.