JSP vs PHP

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2006
Posts: 50
Reputation: kararu is an unknown quantity at this point 
Solved Threads: 0
kararu kararu is offline Offline
Junior Poster in Training

JSP vs PHP

 
0
  #1
Oct 3rd, 2007
Hi all,
I am good in Java.But I dont have any idea about PHP. With this matter in mind please suggest me which to choose(PHP or JSP) to create my own forum.
(coding my own forum..not using exixting freeware forum)....

What are the pros and cons of using JSP.(I dont want to enter into new language php now.Is that okay)

Thanks in advance,
kar.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,505
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: JSP vs PHP

 
0
  #2
Oct 3rd, 2007
If you are comfortable with Java, PHP is really pretty easy to learn. You'll still have to get used to things like state management and passing variables through GET, POST, and SESSION, but you face those in JSP as well as PHP.

Both are just fine for what you want, but finding a host that serves JSP may be a little more work. PHP hosting seems a lot more common to me, but then I haven't looked around a lot so that could just be a misperception.

Personally, I don't like the new "everything must use tags - no Java in JSP pages" mantra they have gone to with the latest JSP spec. Being comfortable with Java, I prefer seeing the code - not tags for things like loops.

That's why I switched to using PHP for my personal web dev stuff.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: JSP vs PHP

 
0
  #3
Oct 4th, 2007
Personally, I don't like the new "everything must use tags - no Java in JSP pages" mantra they have gone to with the latest JSP spec
why not? Clear separation of concerns is where it's at. Mixing business logic with display logic is bad as it makes for code that's hard to expand and maintain.
And as JSPs that are well designed (so with no Java code at all) can be maintained (at least in large part) by people in the web development shop who have no or limited Java experience that's a big bonus.

PHP invites spaghetti code and massively large single code units, just like the old (pre-JSTL) JSP spec did.
It's also far less secure than is JSP, and a lot slower.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,505
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 521
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: JSP vs PHP

 
0
  #4
Oct 4th, 2007
Originally Posted by jwenting View Post
why not? Clear separation of concerns is where it's at. Mixing business logic with display logic is bad as it makes for code that's hard to expand and maintain.
Yeah, I understand what they were going for, but I still just don't like looking at things like loops that have been pressed into a tag format and, being far more used to looking at Java than tags, it seem far clearer and more flexible to have scriplets right there rather than packaged off in a tag library. The only JSP we've used here is a couple of minimal internal DB front ends and our primary focus is desktop development, so honestly we haven't put any effort into redesigning them "properly". At best they are "hacks" to meet a few internal web dev needs that took time we could not afford to waste away from primary development. If web development beyond a CRUD front end was needed, we would take a more organized and proper approach to it. So really my personal dislike of "everything must be tags" stems from that - just a personal thing born of minimal web development and a greater comfort with Java code.
And as JSPs that are well designed (so with no Java code at all) can be maintained (at least in large part) by people in the web development shop who have no or limited Java experience that's a big bonus.
I know that is the hoped for result, but I often wonder just how that works out in practice. Putting "complicated" code constructs into tags doesn't really seem to make them less complicated for the web dev folks - it just makes them look different. They still need the coding skills to understand and maintain those operations. Does it really make such maintenance more accessible to those without coding skills in practice? (Honest question because it's come up in conversation here before and we are all Java devs that haven't worked in large J2EE projects that required such a division of responsibilities)
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: JSP vs PHP

 
0
  #5
Oct 5th, 2007
You shouldn't have complicated code constructs in JSPs at all.
The most complex thing you should put in there is a loop to go through a Collection of data in order to present it, and maybe a switch statement to determine which include to load based on some parameter.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC