[PHP3] Re: php3 Digest 30 Sep 1998 10:00:00 -0000 Issue 457 From: Martin Pool (mbp <email protected>)
Date: 09/30/98

Date: 30 Sep 1998 09:35:43 +0200
To: php3 <email protected>
From: Bjorn Borud <borud <email protected>>
Subject: Re: [PHP3] Java vs PHP
Message-ID: <m23e9arr1s.fsf <email protected>>

[Zeev Suraski <bourbon <email protected>>]
| I think the difference is pretty simple - Java takes a hell of a lot
| more time to develop, but it'll run significantly quicker,
| especially if you have a good Java implementation on your platform.

 bjorn> I haven't used Java servlets myself, but a few friends and
 bjorn> colleagues have been experimenting with it and they say that
 bjorn> the technology is still too immature for production sites.
 bjorn> from what I've heard it's a stability issue: the servlets
 bjorn> would crash and take the server down with them.

I have worked with them a fair bit, and my experience (subject to the
usual disclaimers, of course) is:

 - The technology is stable enough, if you choose the right tools.
   There's an official Apache module at java.apache.org, and there are
   a number of commercial implementations. You also have to choose a
   platform with decent Java support: Solaris, W32, and Linux all seem
   fine now.

 - Servlets are less likely to bring out JVM problems than applets,
   because they don't interact with the bug-prone GUI code. All the
   usual advantages of server-side work apply.

 - Databases are a tricky question: many of the current Java OODBMS
   are a bit unstable. RDBMS are a known technology, and there is a
   standard interface but it's at a slightly lower level than the PHP
   modules.

 - Java is a lovely language for writing reliable complex software, or
   for connecting to things that have Java interfaces.

 - Java handles concurrency very well, which is important on the web.

 - Java's not such a good scripting language: one of the features I
   missed most was simply being able to have quoted strings extend
   over several lines: Perl, Python, and PHP all support this but Java
   doesn't. Perl is perhaps best for one to one-hundred line programs
   and has problems with very large systems; Java is not very good at
   writing little programs. Lots of useful web programs can be
   written in just a few lines. Strong typing and so on are great for
   many things, but perhaps not so good for scripting.

 - Being able to design an OO structure for your web app can be a
   great advantage, if the app is complex enough that it pays off.

 - Having to explicitly compile programs makes it more likely that
   you'll catch bugs at compile time rather than later. On the other
   hand, it does make the cycle a bit slower. Current free
   implementations will automatically compile and reload the source
   when it changes.

 bjorn> as for speed; if what you're making is so complex that PHP is
 bjorn> too slow for you, then you can always extend PHP and write
 bjorn> some new functions in C, but in most cases PHP is fast enough.
 bjorn> I have yet to experience PHP as the bottleneck. in most cases
 bjorn> the database is the bottleneck.

 - I don't imagine Java would be a speed problem, but if the app was
   so speed-intensive that PHP wasn't fast enough then probably
   nothing but C would suffice.

Actually, I'd say that _development_ speed is the bottleneck, and
choosing the right tools is a big contributor or detractor. In short,
I'd say Java servlets are great for apps where you _want_ a bit of
enforced rigidity and structure. One might profitably prototype in
PHP and perhaps rewrite in Java when things get complicated.

--
Martin Pool

network is unreachabl

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3