473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PHP vs. Java

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
20 11619
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
> 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
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
"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
"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
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
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
"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
"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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
1
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
0
by: jaywak | last post by:
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build...
1
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I“m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in...
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.