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.

Recommended Answers

All 4 Replies

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.

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.

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)

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.