Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp, and php learning question  RSS feed

 
derek smythe
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I had personal lessons teaching me PHP for many months, and after many months, I still didn't get it. I think it might have been that I was not as motivated as I am now (I am now really motivated) , and the teachers were TERRIBLE, but anyway here are my questions.

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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you bear, that explained a lot, I liked your quoting of my lines. I just have one more question please. If you know both (you probably do I am guessing, maybe not) which one is more pleasurable to learn and use please? I had a bad experience with PHP, and am very hesitant to go back to it, but if it is easier to learn and use than jsp, I may be forced to use it as my brain is not the best at logical thinking yet, my mind is a BABY at logical thinking, organizing code in a creative way to solve a problem. I am hoping this will improve. I am never going to give up this time. Even if I have to inject code directly into my brain. I will try googling harder for jsp tutorials, I didn't try that long, it was so easy to find php, but I will look harder for jsp. thanks. Derek
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
derek smythe
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Awesome bear! That is awesome. Thank you so much for that very accurate information, and the Head First books are GREAT, I am reading Head First Java right now, I just wanted to map out my future first, and now I know what I will learn and in what order. So I guess any other questions are going to start being code specific. I don't really have any other "future what if" questions now they are all answered. Now I can go back to reading my Head First Java book, really good. I notice that programming books are improving over the years, the teachers are getting better and more "humane". LOL. Thanks for helping my future! Derek
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!