casper_ghost Posted June 25, 2011 Share Posted June 25, 2011 Hello Guy's I know you have seen this question or somewhat of it many of times. But I really need your help to decided. I'm new to programming and stick in the middle of java and php. Everything I have found relating to such questions which is best to learn, the same answer arises. "Depends what you want to do... each has it's strength and weakness and it all comes down to what you want to do with the language, as one will be better then the other" or something on those lines. My questions is without starting a vs war, is what do they do better then each other. or even what do they do the other doesn't. I want to create websites, and possible app's to support those sites. I know java would be suited for the later, but some say java is only used for large web applications. so why can't it be suited for small projects? Anyway I hope you guy's understand what I'm trying to ask. Regards Sorry if I shouldn't post this question here Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/ Share on other sites More sharing options...
xyph Posted June 25, 2011 Share Posted June 25, 2011 PHP has a very loose syntax. It's easy to learn bad habits if it's your first language. Otherwise, both languages have large community support, and both have very large and small web apps designed using them. Your choice. Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234754 Share on other sites More sharing options...
Eiolon Posted June 25, 2011 Share Posted June 25, 2011 Why not learn both? PHP is a server-side language so if you are looking to for user interface control for apps, learning Java can be just as beneficial. Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234755 Share on other sites More sharing options...
xyph Posted June 25, 2011 Share Posted June 25, 2011 Java != JavaScript Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234758 Share on other sites More sharing options...
casper_ghost Posted June 25, 2011 Author Share Posted June 25, 2011 Thank you for your replies. I have thought about learning both, but I'm sure even one will take years to master (but correct me if I'm wrong) Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234760 Share on other sites More sharing options...
Eiolon Posted June 25, 2011 Share Posted June 25, 2011 Java != JavaScript Agreed. However, I have yet to encounter anything programmed in Java that didn't require me to install Java on the client. That is what I was referring to. Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234771 Share on other sites More sharing options...
casper_ghost Posted June 25, 2011 Author Share Posted June 25, 2011 Java != JavaScript Agreed. However, I have yet to encounter anything programmed in Java that didn't require me to install Java on the client. That is what I was referring to. Not sure I follow. why would you need to install on the client.. thought as a web application it will be server side, and any client side applications ran on java runtime already installed on the clients machine (well hopefully unless they just came out from a rock) Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234773 Share on other sites More sharing options...
mikesta707 Posted June 25, 2011 Share Posted June 25, 2011 Thank you for your replies. I have thought about learning both, but I'm sure even one will take years to master (but correct me if I'm wrong) You don't need to master a language to be able to use it effectively. You can easily learn both languages side by side if you put in enough effort. Anyways, back to your topic. You say you want to create websites and perhaps web applications based on that website. A few things I should mention. One, web applications does not necessarily mean you use Java. Web apps is a very broad term, and can encompass programs written in many different languages (PHP, Javascript, Java, Python, RoR, Perl, etc..). What you want to examine is what kind of web apps you want to focus on (as certain languages are better suited for certain jobs.. in a general sense) As far as simple web development (I dont mention design because that includes CSS, which isn't really part of this discussion) PHP is one of the (if not THE) most popular languages for web dev, so I would suggest definitely learning PHP. I would at the very least start learning PHP exclusively, unless you have a clear plan of what you want to accomplish. However, once you have a good basis in PHP, you can decide what kind of project you want to do, and decide what else you need to learn from there. For example, want to make a chat site? Well there are many possible ways to do this (You can do this with PHP, Javascript/AJAX, java, etc.) If you are interested in having persistant user accounts on your site (IE login/registration type websites) then you probably want to look into learning some type of Database, like Mysql(i), msql, etc. to put it simply, what you decide to learn really does depend on what you want to do, but if you want to get into web development, PHP is a great place to start EDIT: Java != JavaScript Agreed. However, I have yet to encounter anything programmed in Java that didn't require me to install Java on the client. That is what I was referring to. Not sure I follow. why would you need to install on the client.. thought as a web application it will be server side, and any client side applications ran on java runtime already installed on the clients machine (well hopefully unless they just came out from a rock) When he says you need to install java on the client, I believe he is referring to the JVM which must be installed on the client, as you mention. In most cases, yes it will already be installed. He is talking more about the fact that while the java code is stored server side, when the applet is run, it is processed by the jvm on the client side. Or at least thats how I interpreted it. Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1234776 Share on other sites More sharing options...
xyph Posted June 29, 2011 Share Posted June 29, 2011 JSP runs entirely server-side, from what I understand. Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1236124 Share on other sites More sharing options...
vbconz Posted June 29, 2011 Share Posted June 29, 2011 EDIT: Java != JavaScript Agreed. However, I have yet to encounter anything programmed in Java that didn't require me to install Java on the client. That is what I was referring to. Not sure I follow. why would you need to install on the client.. thought as a web application it will be server side, and any client side applications ran on java runtime already installed on the clients machine (well hopefully unless they just came out from a rock) When he says you need to install java on the client, I believe he is referring to the JVM which must be installed on the client, as you mention. In most cases, yes it will already be installed. He is talking more about the fact that while the java code is stored server side, when the applet is run, it is processed by the jvm on the client side. Or at least thats how I interpreted it. My $.02 worth. PHP for server side logic is perfect in that it is specifically designed to work with web sites / web servers. JSP - Java Server Pages, is also designed to work with servers on the server side but requires a less common server to run it (e.g. Tomcat / Domino / Websphere ....) Java - will allow you to run autonomous apps that dont require a web browser but can get data from remote (e.g. web servers). Java is more secure running in a sandbox / jvm than running web apps in a non-sand boxed web browser. (e.g. applets) Java script - allows you to script stuff inside of a web browser on the client side. My thought - If you only want to learn one langguage and work with the web then php. You can write complete cross browser / cross platform apps just using php. however dont fool yourself that what ever you write, if it is web based will be one language only. To write web apps you will neeed a minimum of: HTML CSS Java Script One server side language (php or JSP) Possibly SQL No web app will get written without knowing the top three - well maybe without knowing css but the site will get ugly to maintain really quickly. Think of a web app as an n-tier app. Teir 1 - Database Teir 2 - Logic Teir 3 - Display / layout Teir 1 you will need sql. to use sql and access it you will need an sql capable server side language such as php or jsp. Teir 2 - Split it in two - Logic on the server side (stored procedures, business logic in returned / posted forms, work flow) JSP/ PHP / SQL - Logic in the browser - button clicks, validation, display, browser identification etc - JavaScript / VBScript Teir 3 - HTML and CSS - Required to layout the pages, present and format data. Also some server side input for getting queried data laid out in tables etc. If you want to write applets or other java applications (beans, applets etc are ideal for quick and dirty or small development pieces) then you will need to learn a whole new subset of java, over and above jsp / javascript. (yes I know javascript != java but it is syntactically similar) including jdbc / swing / soap / corba / xml etc. Believe me that is far more painful than knowing php and javascript. Java gui is a whole new level of headache. PHP, html / java script are close enough in use to think of them as complimentary. They are all implemented in html like pages, they have similar syntax in many cases, they are untyped (ie no really fixed data types) and work in with web apps. If you are going to go through the pain of learning and using html / css you are already doing teir 3 work using similar / same languages as teir 2. Doing teir 3 with java you need to add a whole layer of complexity AND will still have to learn jscript, html, sql, css etc. Also dont forget that JavaScript, HTML DOM, DHTML, VBScript, AJAX, jQuery, E4X, svg are also likely to be needed to get web apps working. PHP is much kinder to do that stuff with than java apps. my $0.02 shane Quote Link to comment https://forums.phpfreaks.com/topic/240389-help-to-decided/#findComment-1236131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.