944,144 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 6944
  • Java RSS
Oct 3rd, 2007
0

JSP vs PHP

Expand Post »
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.
Similar Threads
Reputation Points: 20
Solved Threads: 0
Junior Poster in Training
kararu is offline Offline
50 posts
since Sep 2006
Oct 3rd, 2007
0

Re: JSP vs PHP

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.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Oct 4th, 2007
0

Re: JSP vs PHP

Quote ...
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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Oct 4th, 2007
0

Re: JSP vs PHP

Click to Expand / Collapse  Quote originally posted by jwenting ...
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.
Quote ...
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)
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Oct 5th, 2007
0

Re: JSP vs PHP

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: password Authentication without database
Next Thread in Java Forum Timeline: serial Port programming





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC