[ale] J2EE vs PHP

Ronald Chmara ron at Opus1.COM
Thu Mar 11 16:32:31 EST 2004


On Mar 11, 2004, at 10:34 AM, Fletch wrote (and quoted):
> You might want to check out this paper.  I've quoted the conclusion
> paragraph below.  And I trust there's no confusion about what I'd
> sugguest instead of either of your sugguestions. :) (mod_perl
> underneath either HTML::Mason or Template Toolkit, of course)
>
> Experiences of Using PHP in Large Websites
> http://www.ukuug.org/events/linux2002/papers/html/php/
>
> 7. Conclusions
>
> PHP is a convenient language for rapidly prototyping simple dynamic
> websites.

Yes. It just so happens that almost *all* websites don't happen to 
require a mainframe backend, and thus are relatively "simple". It's 
also worth noting that just because a company may need a mainframe to 
manage their supply chain *doesn't* mean that their web interface for 
changing email passwords also has to run on a mainframe.... (It always 
give me the giggles when I see a massive code architecture for a form 
submission, SQL query, and a results page).

> For more experienced developers, though, the language's simplicity
> rapidly turns into complexity, slowing down the development
> process.

Wrong. The individual cases made in the article to attempt to show this 
point are all
a) about specific programming paradigms, where somebody tried to make a 
programming language fit their given workflow or mentality, rather than 
the other way around.
or
b) demonstrations of a lack of knowledge in how to scale PHP properly 
in very simple ways.

>  These developers are the ones who have the skills needed to
> build large and/or complex websites; using PHP for such sites
> therefore tends to be a net loss.

... "experienced" developers such as the author of the article, I 
presume? ;-) (If $DEVELOPER can't use it efficiently, $LANGUAGE must be 
what's at fault?)

I won't bother with point by point rebuttals (it would take far, far, 
too much time), so lets just take one, single, gripe, for an example of 
the overall problems with the article: "There are multiple deployed 
versions of PHP".

Now the author might simply have realized that every language has 
multiple deployments, and thus coded for in such a way as to test what 
deployment is in use, or coded for the lowest common version.... but 
no, PHP is faulted because in the computer world, there are versions of 
software!  Oh my!

Of course, any enterprise-level programmer *expects* multiple possible 
runtime targets, and thus avoids using target-specific features, or 
selectively tests for features before using them, or includes the 
target-specific items as runtime requirements. If one doesn't know what 
version of perl is going to be in use (with what CPAN modules), or what 
version of java is in use, or what version of bash is in use, is the 
*language* at fault because the programmer is choosing to use version 
and implementation-specific features?

*sigh*....

I've worked on sites that average 8,000 unique application users (not 
page hits, no bulletin board readers but active application users) per 
day, doing accounting, content management, document management, online 
ordering, geographic location tracking, shopping carts, n-level 
authentication, connecting to 8 data sources, all in PHP, built during 
3 massive PHP revisions (the author of the above article also 
demonstrates a near-total ignorance of PHP's evolution). PHP is quite 
easily scalable, if one simply takes the time to learn *how*. Same as 
most other languages....but trying to scale perl in the *same* way as 
PHP in the *same* way as ASP in the *same* way as J2EE? That way 
madness lies. Each environment scales differently.

Is one or another language required for a given project? Perhaps. If, 
for example, $COMPANY has a programming process or business 
requirements that requires an implementation that only matches a 
specific language. That's not about the language's ability though, 
that's about the implementation details.

Personally, I prefer PHP, but that's all about how I program, and I 
haven't seen a whole lot that I *can't* do (on an application level) in 
PHP. One thing the article does get right (but in the wrong way) is 
that programming language $FOO will always have some things that you 
can't do in the same way as programming language $BAR. So, it often 
comes down to personal comfort, and ability in a given language or 
programming paradigm.

As far as the original poster and question goes:

> I'm working on a big web project and am not sure which language to use.
> When would one choose PHP over J2EE?

IMNSHO:
When one needs highly rapid feature implementation and version 
iteration.
When one needs to keep hardware overhead down.
When one's application is primarily web-and-db-centric.
When one is not bound to using a specific programming style.
When one is going to be using pre-existing PHP code bases to build from 
(or with).
When one doesn't want their job to be farmed to India. ;-)

-Bop



More information about the Ale mailing list