473,397 Members | 1,960 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,397 software developers and data experts.

Discussion: PHP versus JSP

Hi! I recently completed a graduate level Java class at a local
university. For our class project my group built a web-based
application. Basically, the application would let a manufacturing
company sell any 'extra' inventory to any authorized user via the
internet. The users could log in, view the inventory available, and
make a bid on any of the inventory available. At the end of the day,
the highest bidder 'wins' that inventory and would receive an email
saying as much. The customer could then log in again and enter a
purchase order number and a sales order would be generated.

This application was pretty basic. We used MySQL, Tomcat, and JSP. I
especially liked working with JSP (give me JSP over servlet
programming anyday!). However, a friend of mine said that he would
rather use PHP for web-based apps and asked me what I thought of
re-doing the app using PHP. Well, I've never really done a lot with
PHP (other than go through one of those 'Learn PHP in 24 hours' books)
so I'm not sure what the advantage or disadvantage would be in doing
that. I'm not even sure if PHP could be used to acess MySQL or other
databases (my book didn't get into that).

This brings me to my question: What are your thoughts on JSP versus
PHP? I'm not an expert on either one, but I'd be interested in the
thoughts of others on these two different web development tools.

Thanks and have a great week!

Kevin
Jul 17 '05 #1
6 8662
Kevin wrote:

This brings me to my question: What are your thoughts on JSP versus
PHP? I'm not an expert on either one, but I'd be interested in the
thoughts of others on these two different web development tools.
Well first my thoughts about the PHP + mysql combination. Php and MySql
are great languages for small web sites, but fail at the enterprise
level. MySql is not a "true" dbms, it doesn't support sub queries,
triggers, refferential integrity and stored procedures. The fact that
it doesn't support triggers can lead to corruption of the database quite
easily. The fact that it doesn't support stored procs means that on
your database front end application AND in your web components, you have
to mantain 2 sets of queries. You can't change the database without
changing the code, which is a pain. But MySQL is a FAST dbms, it can
handle 3000 queries in a page without a huge slowdown.

I used to work for a development firm that did websites for fortune 500
companies. We used both PhP and J2EE (although we did not use
Enterprise Java Beans, we developed our own technology).

Developing a web site in java is a lot more expensive than developing it
in PHP. I'me not only talking about license costs. A PhP developer can
be bought for as low as 12$/hr, even if your doing OO in PhP (which is
the way it should be done to insure portability and scallability).

Java programmers are usually more expensive to get. Java uses some
methodology and advanced OO ideas that aren't exactly common to most "i
learnt how to program at home" programmers. Typically, in Ottawa at
least, Java programmers were paid 45K to 65K CAD. PhP programmers were
paid 35K to 55K. It is also a lot harder to find qualified java
personel, compared to php developers.

Also java is a purist language, it requires a purist attitude to writing
code. This means that in your project, two things may happen.
1) Beautiful, well documented code, well scallable, well designed code
has been written
2) The programmer didn't know how to lay it out properly so he "made it
work", it is now unscallable.

It's really hit or miss, more so than in other languages i find. Java
also takes more time to write than php, but it does have a more
extensive library support so you have to take that into account.

in either case, on the PHP and the Java side, both should be seperated
in an MVC type of arrangement (or at least, business logic and
presentationlogic). This type of thing will let you build a component
that can be displayed differently on many pages. Services have to be
created in any case for general things like logging, database managment,
component properties etc.

Hope it helps :)

Thanks and have a great week!

Kevin

Jul 17 '05 #2
nos

"Kevin" <ja*********@hotmail.com> wrote in message
news:62*************************@posting.google.co m...
Hi! I recently completed a graduate level Java class at a local
university. For our class project my group built a web-based
application. Basically, the application would let a manufacturing
company sell any 'extra' inventory to any authorized user via the
internet. The users could log in, view the inventory available, and
make a bid on any of the inventory available. At the end of the day,
the highest bidder 'wins' that inventory and would receive an email
saying as much. The customer could then log in again and enter a
purchase order number and a sales order would be generated.

This application was pretty basic. We used MySQL, Tomcat, and JSP. I
especially liked working with JSP (give me JSP over servlet
programming anyday!). However, a friend of mine said that he would
rather use PHP for web-based apps and asked me what I thought of
re-doing the app using PHP. Well, I've never really done a lot with
PHP (other than go through one of those 'Learn PHP in 24 hours' books)
so I'm not sure what the advantage or disadvantage would be in doing
that. I'm not even sure if PHP could be used to acess MySQL or other
databases (my book didn't get into that).

This brings me to my question: What are your thoughts on JSP versus
PHP? I'm not an expert on either one, but I'd be interested in the
thoughts of others on these two different web development tools.

Thanks and have a great week!

Kevin


I am surprised that they offer java as a graduate level course.
Kids today learn this in high school.
Jul 17 '05 #3
You could integrate PHP with PostgreSQL, there is library support for it and
PstgreSQL supports all the features mentioned above by Yoyoma.
It is faster to prototype in PHP than java and there is no need for
complicated context management for the PHP application in comparison to
Servlets on Tomcat or any other servlet engine. PHP has some other problems
though, one of which is it is a stateless language, you can not store
information persistently easily. The only way to achieve that is to use the
SESSION variable and when your script finished executing there is nothing
left. This might be important if you want to maintain persistent
connectivity with some resources or serve out some persistent data, etc.
This is where Java could be more powerful than PHP, in applications that
require persistence.

"nos" <no*@nospam.com> wrote in message
news:WK4ac.127822$1p.1745804@attbi_s54...

"Kevin" <ja*********@hotmail.com> wrote in message
news:62*************************@posting.google.co m...
Hi! I recently completed a graduate level Java class at a local
university. For our class project my group built a web-based
application. Basically, the application would let a manufacturing
company sell any 'extra' inventory to any authorized user via the
internet. The users could log in, view the inventory available, and
make a bid on any of the inventory available. At the end of the day,
the highest bidder 'wins' that inventory and would receive an email
saying as much. The customer could then log in again and enter a
purchase order number and a sales order would be generated.

This application was pretty basic. We used MySQL, Tomcat, and JSP. I
especially liked working with JSP (give me JSP over servlet
programming anyday!). However, a friend of mine said that he would
rather use PHP for web-based apps and asked me what I thought of
re-doing the app using PHP. Well, I've never really done a lot with
PHP (other than go through one of those 'Learn PHP in 24 hours' books)
so I'm not sure what the advantage or disadvantage would be in doing
that. I'm not even sure if PHP could be used to acess MySQL or other
databases (my book didn't get into that).

This brings me to my question: What are your thoughts on JSP versus
PHP? I'm not an expert on either one, but I'd be interested in the
thoughts of others on these two different web development tools.

Thanks and have a great week!

Kevin


I am surprised that they offer java as a graduate level course.
Kids today learn this in high school.

Jul 17 '05 #4

"Kevin" <ja*********@hotmail.com> wrote in message
news:62*************************@posting.google.co m...
Hi! I recently completed a graduate level Java class at a local
university. For our class project my group built a web-based
application. Basically, the application would let a manufacturing
company sell any 'extra' inventory to any authorized user via the
internet. The users could log in, view the inventory available, and
make a bid on any of the inventory available. At the end of the day,
the highest bidder 'wins' that inventory and would receive an email
saying as much. The customer could then log in again and enter a
purchase order number and a sales order would be generated.

This application was pretty basic. We used MySQL, Tomcat, and JSP. I
especially liked working with JSP (give me JSP over servlet
programming anyday!). However, a friend of mine said that he would
rather use PHP for web-based apps and asked me what I thought of
re-doing the app using PHP. Well, I've never really done a lot with
PHP (other than go through one of those 'Learn PHP in 24 hours' books)
so I'm not sure what the advantage or disadvantage would be in doing
that. I'm not even sure if PHP could be used to acess MySQL or other
databases (my book didn't get into that).

This brings me to my question: What are your thoughts on JSP versus
PHP? I'm not an expert on either one, but I'd be interested in the
thoughts of others on these two different web development tools.

Thanks and have a great week!

Kevin


Hello Kevin,

JSP is an attempt from the Java camp to achieve an ASP/PHP like programming
level for Java. JSP can be combined with Java classes which enables a more
structured approach to development making large systems more manageable than
when working with PHP (although many PHP advocates will contradict this they
are wrong). PHP adds nothing to what JSP offers. You win some deployment
ease at the cost of poor libraries, an inferiour programming language and
reduced scalability.

Although there is little wrong with programming a dynamic website with
JSP/ASP/PHP it really scales poorly, even when combined with taglibraries
and plain Java classes. JSP introduces more development issues than it
solves (generating HTML or sometimes XML) because of the new principles
introduced by the combination mechanics. If you want to build a serious
web-application going the servlet way in combination with some
template-library or other class library that takes care of the HTML/XML is a
much more structured and scalable approach.

When talking about Java Servlets are the real thing and JSP is entry level
stuff blown up into more than it actually is. Stay pragmatic and rethink
your strategy for each project. Asking advice is alway a good idea.

Silvio Bierman
Jul 17 '05 #5
ja*********@hotmail.com (Kevin) wrote in message news:<62*************************@posting.google.c om>...
Hi! I recently completed a graduate level Java class at a local
university. For our class project my group built a web-based
application. Basically, the application would let a manufacturing
company sell any 'extra' inventory to any authorized user via the
internet...


Thanks, everyone, for the great information and comments. You've
really broadened my horizons, so to speak, and I'm exploring a few
ideas that I've come up with while reading your comments.

Again, thank you so much!

Kevin
Jul 17 '05 #6
Right... just like they learned VB and C in high-school in the past.

The fact is: learning a language syntax (Java) means jack.

USING Java means you understand OO, have read GoF (at least), and probably
use ANT, JUnit and Log4j. That's not the subject in high-school
class-rooms.

Keep the "High-school students use this technology" in the Microsoft forum.
That's where it belongs.

"nos" <no*@nospam.com> wrote in message
news:WK4ac.127822$1p.1745804@attbi_s54...

I am surprised that they offer java as a graduate level course.
Kids today learn this in high school.

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our...
15
by: John Salerno | last post by:
After my last post, I thought of another question as a result of the following: ------------------------------ Mike Meyer wrote: > John Salerno <johnjsal@NOSPAMgmail.com> writes: > > >>So...
2
by: Andrew Robinson | last post by:
I need to create a shared static field for use within a number of different classes. Which one should I be using or are they all really the same thing? public class Widget { private Widget() {}...
66
by: Cor | last post by:
Hi, I start a new thread about a discussion from yesterday (or for some of us this morning). It was a not so nice discussion about dynamically removing controls from a panel or what ever. It...
2
by: Jon Lapham | last post by:
I have a table that stores TEXT information. I need query this table to find *exact* matches to the TEXT... no regular expressions, no LIKE queries, etc. The TEXT could be from 1 to 10000+...
0
by: Harry Smith | last post by:
This was posted in news.groups, but it was not posted to the list. REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.postgresql.admin unmoderated group...
8
by: cat | last post by:
I had a long and heated discussion with other developers on my team on when it makes sense to throw an exception and when to use an alternate solution. The .NET documentation recommends that an...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
4
by: aj | last post by:
DB2 8.2 LUW FP14 Is there any real difference between select blahblahblah... where blah IN (select blah......) versus select blahblahblah... where blah = ANY (select blah.....) versus select...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.