Once I know Java, is jsp easier to learn than php? I see a lot more resources for php learning on the net, and w3schools.com does not include jsp for some reason,, but I am less eager to learn PHP because of my BAD experience. Does Java have any similarity to jsp or is it very different?
Is there any benefit of learning one or the other, I read that php is better in that it is supported by almost everyone. Well, if I cannot find enough tutorials on jsp, I may have no choice but to study php again but try harder, or learn Java and then maybe that will make learning php less difficult and less painful. I am inspired to learn Java but for php, nope.
Any help greatly appreciated. thank you. Derek
derek smythe wrote:Once I know Java, is jsp easier to learn than php?
Modern JSP contains no Java code, so learning JSP actually has little to do with Java itself. The Java learning comes in when writing controllers and the support backend for the JSPs. Unlike PHP, in Java web apps the pages are not used to perform data manipulation or processing but are simple view components. All the heavy lifting is done in Java classes, not in the pages.
So even if Java itself is not used in the JSPs, you need to know Java so that you can write the classes that support the JSPs.
Does Java have any similarity to jsp or is it very different?
I do not understand this question.
Is there any benefit of learning one or the other, I read that php is better in that it is supported by almost everyone.
"Better supported"? In what way? If you mean that more hosting providers support PHP than JSP. Then, yes. This however, is hardly a metric that I would consider for determining "better".
Well, if I cannot find enough tutorials on jsp
There are many resources for learning JSP. Too many in fact. The problem is not in finding them, but in finding one that doesn't lead you down the wrong path. A lot of tutorials out there are crap and try to teach you JSP as it was written 10 years ago (with embedded Java).
derek smythe wrote:which one is more pleasurable to learn and use please?
I detest PHP because it forces you to follow (what I consider) bad practices and doesn;t allow you to logically separate the code into MVC layers (look up Separation of Concerns). To me, it's a lot like writing JSPs in the bad old days when Java code was crammed into the pages and all that resulted was a mess.
I wrote this article that discusses that and examines proper Java web app structuring.
but if it is easier to learn and use than jsp
JSP itself is easy. What seems to throw most people for a loop is learning to structure web apps well, and to write the Java outside of the JSPs. If you look at the questions posted in this very forum you will see that scores of people are still irresponsibly writing JSPs with java code embedded as if it were still 2001.
PHP may be perceived as "easier" because there's little choice and you never have to learn proper engineering techniques.
I would recommend Head First Servlets and JSP, as long as you realize that the Java embedding, though still part of JSP, is discredited and should not be used.