By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

PHP vs. Java

P: n/a
bb
I'm not a Perl programmer nor a Linux adherent. What are the advantages of
LAMP vs.the Java model for building data-driven websites? I do a fair amount
of
development using Tomcat/JSP/Servlets with Struts for clients. I see more
and more ads for
LAMP/PHP developers. What are the advantages and tradeoffs? All opinions
welcomed....


Jul 16 '05 #1
Share this Question
Share on Google+
20 Replies


P: n/a
RG

"bb" <bi***********@verizon.net> wrote in message
news:9d**************@nwrdny03.gnilink.net...
I'm not a Perl programmer nor a Linux adherent. What are the advantages of
LAMP vs.the Java model for building data-driven websites? I do a fair amount of
development using Tomcat/JSP/Servlets with Struts for clients. I see more
and more ads for
LAMP/PHP developers. What are the advantages and tradeoffs? All opinions
welcomed....


PHP is easier to learn, it actually reads like english.
Nearly all Linux servers are offering PHP and MySQL which means cheaper
prices for shared space.
This is of course my biased opinion because I have never even looked into
servlets.
RG
Jul 16 '05 #2

P: n/a
> Struts and similar systems are purported to separate the tasks of
programming and designing web pages. I really don't think such
separation can ever be complete. I think you come up with better UI if
you don't try to create such separation. The UI should be a natural
extension of what the user does with the data.


And that's why using a MVC(2) system is best. Because you can keep the
same back-end, and use it with different front-ends. The coding can be
complete. We have a completely separated system and it's completely
written in PHP making use of our own Struts-Like application, Smarty, and
many of the PEAR modules. Read up on Struts and MVC(2) systems, you'll
see the light. Putting your logic and control inside of a page that
contains HTML is horrible to pick up and understand. At the very least
the separation makes things easier.

~ Metnetsky
Jul 16 '05 #3

P: n/a
On Tue, 08 Jul 2003 12:46:44 -0700, RG wrote:

"bb" <bi***********@verizon.net> wrote in message
news:9d**************@nwrdny03.gnilink.net...
I'm not a Perl programmer nor a Linux adherent. What are the advantages of
LAMP vs.the Java model for building data-driven websites? I do a fair

amount
of
development using Tomcat/JSP/Servlets with Struts for clients. I see more
and more ads for
LAMP/PHP developers. What are the advantages and tradeoffs? All opinions
welcomed....


PHP is easier to learn, it actually reads like english.
Nearly all Linux servers are offering PHP and MySQL which means cheaper
prices for shared space.
This is of course my biased opinion because I have never even looked into
servlets.
RG


PHP is generally easier. But with PHP5 it's going to become the
Java-Scripting-Language as it's a near replicate minus variable types. I
love PHP and I love Java. Each have their points. Generally PHP can
handle everything from small to mid-size without a problem. It can even
handle some huge sites (at work we're developing a massive community based
system in pure PHP - but we're knocking on the walls pretty hard). For
high-end systems I would suggest Java. It REQUIRES that you truly think
throw your entire systems model and forces you to have everything in place
before you begin and realize you're screwed. Most PHP applications are
hacks, for better or worse (depends on who you ask). And if you ask most
the PHP's creators they'll tell you that PHP should just control template
logic and all control/model patterns should be written as PHP modules in
C. My point is simply this, everyone has an opinion and they're all right
and wrong.

Personally I like the design patterns that most Java applications make use
of. That just happens to be my cup of coffee. But if you like coding
directly in the pages, use PHP, it's far easier than pure JSP.
Jul 16 '05 #4

P: n/a
"Metnetsky" <mi******@syr.edu> writes:
The UI should be a natural
extension of what the user does with the data.


And that's why using a MVC(2) system is best.


With a feature-complete databse like PostgreSQL, all business logic can
be at the database level. The database is the back end. Put as many
light-weight front ends on as you wish. The only logic that needs to be
embedded in web pages is UI logic.

--
"Notwithstanding fervent argument that patent protection is essential
for the growth of the software industry, commentators have noted
that `this industry is growing by leaps and bounds without it.'"
-- US Supreme Court Justice John Paul Stevens, March 3, 1981.
I rarely read mail sent to br*****@yahoo.com
Jul 16 '05 #5

P: n/a
"bb" <bi***********@verizon.net> wrote
in message news:<9d**************@nwrdny03.gnilink.net>...

I'm not a Perl programmer nor a Linux adherent. What are
the advantages of LAMP vs.the Java model for building
data-driven websites? I do a fair amount of development
using Tomcat/JSP/Servlets with Struts for clients. I see
more and more ads for LAMP/PHP developers. What are the
advantages and tradeoffs?


One person's advantage may well be another person's drawback.
For example, I like that PHP does not force the developer into
an object-oriented development paradigm. I tend to think that
Web development is quite often better done with old-fashioned
procedural programming. So I like having an option to steer
clear from OOP when I think OOP is inappropriate for the task
at hand. For you, with your Java background, this may sound
like the ultimate heresy.

Cheers,
NC
Jul 16 '05 #6

P: n/a
On Tue, 08 Jul 2003 12:39:00 -0400, Bruce Lewis wrote:
"Metnetsky" <mi******@syr.edu> writes:
> The UI should be a natural
> extension of what the user does with the data.


And that's why using a MVC(2) system is best.


With a feature-complete databse like PostgreSQL, all business logic can
be at the database level. The database is the back end. Put as many
light-weight front ends on as you wish. The only logic that needs to be
embedded in web pages is UI logic.


Not to start a flame-fest, but no database is smart enough to handle half
of the business logic that any medium size website has. Does your code
only do simple CRUD statements? And the best part about an MVC system is
that you can CHANGE your view (HTML/XML/SOAP/etc) without having to change
your control or business logic.
Jul 16 '05 #7

P: n/a
On Tue, 08 Jul 2003 22:28:04 +0000, James wrote:
On Tue, 08 Jul 2003 11:40:42 -0400, "Metnetsky" <mi******@syr.edu>
scrawled:
On Tue, 08 Jul 2003 12:46:44 -0700, RG wrote:

"bb" <bi***********@verizon.net> wrote in message
news:9d**************@nwrdny03.gnilink.net...
I'm not a Perl programmer nor a Linux adherent. What are the
advantages of LAMP vs.the Java model for building data-driven
websites? I do a fair
amount
of
development using Tomcat/JSP/Servlets with Struts for clients. I see
more and more ads for
LAMP/PHP developers. What are the advantages and tradeoffs? All
opinions welcomed....

PHP is easier to learn, it actually reads like english. Nearly all
Linux servers are offering PHP and MySQL which means cheaper prices
for shared space.
This is of course my biased opinion because I have never even looked
into servlets.
RG


PHP is generally easier. But with PHP5 it's going to become the
Java-Scripting-Language as it's a near replicate minus variable types.
I love PHP and I love Java. Each have their points. Generally PHP can


But what about the memory limitations of Java 1.4.1 which requires a
minimum of 256Mb to simply run! As usual Sun has shot Java in the foot,
in the fact that it takes up too much space to allow multiple processes
to run....
handle everything from small to mid-size without a problem. It can even
handle some huge sites (at work we're developing a massive community
based system in pure PHP - but we're knocking on the walls pretty hard).
For high-end systems I would suggest Java. It REQUIRES that you truly
think


For hi-end systems I wouldn't even contemplate Java - unless you can
afford an order of magnitude spend on hardware to cope with the demand
for services
throw your entire systems model and forces you to have everything in
place before you begin and realize you're screwed. Most PHP
applications are hacks, for better or worse (depends on who you ask).
And if you ask most


I agree with this - BUT you can write good PHP - just you can write bad
PHP and it works - but you can't really write bad Java and get it to
work (it is only the memory problems which are bad with Java)
the PHP's creators they'll tell you that PHP should just control
template logic and all control/model patterns should be written as PHP
modules in C. My point is simply this, everyone has an opinion and
they're all right and wrong.

Personally I like the design patterns that most Java applications make
use of. That just happens to be my cup of coffee. But if you like
coding directly in the pages, use PHP, it's far easier than pure JSP.


I can't even imaging getting most of my programmes working in Java and
coping with the peak server load that we have on the servers I use.

I use either mod_perl or PHP....


http://www.onjava.com/pub/a/onjava/2.../04/nukes.html
Jul 16 '05 #8

P: n/a
"Metnetsky" <mi******@syr.edu> wrote in message
news:<pa****************************@syr.edu>...
NC> I like that PHP does not force the developer into an
NC> object-oriented development paradigm.
Have you seen PHP5?


No, but from what I hear and read, I am not going to like it... :)

Cheers,
NC
Jul 16 '05 #9

P: n/a
"Metnetsky" <mi******@syr.edu> writes:
Not to start a flame-fest, but no database is smart enough to handle half
of the business logic that any medium size website has.


I guess the easy way to avoid a flame fest would be to post an example
of business logic that cannot be handled by a database. That would shut
up all the flamers, wouldn't it?

Go ahead. I'm waiting.

--
"Notwithstanding fervent argument that patent protection is essential
for the growth of the software industry, commentators have noted
that `this industry is growing by leaps and bounds without it.'"
-- US Supreme Court Justice John Paul Stevens, March 3, 1981.
Jul 16 '05 #10

P: n/a
On Tue, 08 Jul 2003 19:30:22 -0400, "Metnetsky" <mi******@syr.edu>
wrote:
http://www.onjava.com/pub/a/onjava/2.../04/nukes.html


Ok, so one high traffic site ran into problems when they implemented
nuke. This supports what James said -- you can write good code and
you can write bad code. Coincidentally, what is good code for one
site might be horrendous for another.

If your argument is simply that PHP can't handle high traffic sites,
then what about Yahoo!?
http://public.yahoo.com/~radwin/talk...phpcon2002.htm

Application, Hardware, OS, and network infrastructure are all integral
parts of designing a website. If you think nuke was a bad idea for
the site above, you should have seen what one of the world's largest
financial institutions did with Java. I witnessed millions of dollars
in revenue loss daily where the network infrastructure was extremely
over-designed and the Java application was underdeveloped and couldn't
handle it. (I don't miss working there...)
Jul 16 '05 #11

P: n/a
James wrote:

For hi-end systems I wouldn't even contemplate Java -


For an enterprise-level system, I wouldn't contemplate anything else.

Jul 16 '05 #12

P: n/a
With total disregard for any kind of safety measures "Metnetsky"
<mi******@syr.edu> leapt forth and uttered:
Have you seen PHP5? Pure OOP. Slightly scarey if you ask me,
since it's just more text to be processed, and then executed.


PHP5 is not 'pure OOP' as this would break backwards-compatibility
with damn near every single PHP app on the net. It merely has a bunch
of new OO constructs is all. You're still free to hack away at
procedural cod if thats what floats your boat.

--
There is no signature.....
Jul 16 '05 #13

P: n/a
On Wed, 09 Jul 2003 11:19:46 -0400, mike s wrote:
On Tue, 08 Jul 2003 19:30:22 -0400, "Metnetsky" <mi******@syr.edu>
wrote:
http://www.onjava.com/pub/a/onjava/2.../04/nukes.html


Ok, so one high traffic site ran into problems when they implemented
nuke. This supports what James said -- you can write good code and you
can write bad code. Coincidentally, what is good code for one site
might be horrendous for another.

If your argument is simply that PHP can't handle high traffic sites,
then what about Yahoo!?
http://public.yahoo.com/~radwin/talk...phpcon2002.htm

Application, Hardware, OS, and network infrastructure are all integral
parts of designing a website. If you think nuke was a bad idea for the
site above, you should have seen what one of the world's largest
financial institutions did with Java. I witnessed millions of dollars
in revenue loss daily where the network infrastructure was extremely
over-designed and the Java application was underdeveloped and couldn't
handle it. (I don't miss working there...)


PHP is going to be used as the front-end template language while PHP
extensions written in PURE C will be doing almost all the logic and
back-end management. Rasmus will be helping them with this.

I love PHP, always have and always will. But I also love Java, they have
their strengths and weaknesses. Both must be recognized.
Jul 16 '05 #14

P: n/a
Java great measure of isolation from the operating system is the
advantage on microsoft operating systems, where unwanted suprises are
always likely to happen.

DG
Jul 16 '05 #15

P: n/a
Drazen Gemic <dg****@nospam.net> wrote in message news:<pa********************************@nospam.ne t>...
Java great measure of isolation from the operating system is the
advantage on microsoft operating systems, where unwanted suprises are
always likely to happen.


To summarize, then:

Small-Medium Sites: PHP is good.

Big Sites: Java is good.
Jul 16 '05 #16

P: n/a
lawrence:
Drazen Gemic <dg****@nospam.net> wrote in message
news:<pa********************************@nospam.ne t>...
Java great measure of isolation from the operating system is the
advantage on microsoft operating systems, where unwanted suprises are
always likely to happen.


To summarize, then:

Small-Medium Sites: PHP is good.

Big Sites: Java is good.


Define Small-Medium and Big. Do you mean in terms of traffic? Complexity?
Functionality?

André Nęss
Jul 16 '05 #17

P: n/a
On Wed, 09 Jul 2003 10:07:50 -0400, Bruce Lewis wrote:
"Metnetsky" <mi******@syr.edu> writes:
Not to start a flame-fest, but no database is smart enough to handle
half of the business logic that any medium size website has.


I guess the easy way to avoid a flame fest would be to post an example
of business logic that cannot be handled by a database. That would shut
up all the flamers, wouldn't it?

Go ahead. I'm waiting.


You can very well put a lot of your core logic into stored procedures in a
relational database, but more advanced logic such as recursive functions
and what not would be much more complex to develop in procedural SQL.
Moreover, if you have your back-end logic compiled [java, c] would be
faster than a database. Also using your logic in code instead of the db
would make your life easier with various interfaces such as soap, flash,
etc. as well as a better error handling.
Jul 16 '05 #18

P: n/a
André Nęss <an*********************@ifi.uio.no> wrote in message news:<be**********@maud.ifi.uio.no>...
lawrence:
Drazen Gemic <dg****@nospam.net> wrote in message
news:<pa********************************@nospam.ne t>...
Java great measure of isolation from the operating system is the
advantage on microsoft operating systems, where unwanted suprises are
always likely to happen.


To summarize, then:

Small-Medium Sites: PHP is good.

Big Sites: Java is good.


Define Small-Medium and Big. Do you mean in terms of traffic? Complexity?
Functionality?


What difference do you mean to highlight by asking first about
complexity and then about funtionality? What is the difference that
you see?
Jul 16 '05 #19

P: n/a
lawrence:
> To summarize, then:
>
> Small-Medium Sites: PHP is good.
>
> Big Sites: Java is good.


Define Small-Medium and Big. Do you mean in terms of traffic? Complexity?
Functionality?


What difference do you mean to highlight by asking first about
complexity and then about funtionality? What is the difference that
you see?


Complexity: Very complex operations need to be performed to serve requests,
e.g. doing huge calculations on each request (for whatever purpose).

Functionality: Lots of functionality :) Basically the number of things users
can do, each task may be simple or complex to actually implement. Making
them all interact an work together can be hard.

And I would also like to add another axis: Large/small datasets. Is the site
big or small in terms of the data it supplies? For example a site that
offers basic queries towards a database of all known movies has a large set
of data but doesn't have to be neither complex nor rich in functionality.

All these obviously overlap, but different sites will have different
profiles. My main point was of course that your very simple rule is in fact
far too simple.

André Nęss
Jul 16 '05 #20

P: n/a
André Nęss <an*********************@ifi.uio.no> wrote in message
Complexity: Very complex operations need to be performed to serve requests,
e.g. doing huge calculations on each request (for whatever purpose).

Functionality: Lots of functionality :) Basically the number of things users
can do, each task may be simple or complex to actually implement. Making
them all interact an work together can be hard.

And I would also like to add another axis: Large/small datasets. Is the site
big or small in terms of the data it supplies? For example a site that
offers basic queries towards a database of all known movies has a large set
of data but doesn't have to be neither complex nor rich in functionality.

Then, obviously, the answer is complexity.
Jul 16 '05 #21

This discussion thread is closed

Replies have been disabled for this discussion.