Jump to content

Advantages of Java- should I learn it?


Fmdpa

Recommended Posts

I have an opportunity to learn Java right now, and I would like to have your input considering this. I'm focusing on PHP and Ruby right now, and I feel that I would be quite rounded with those languages. (then again, I thought exactly before I began Ruby...)I'd love to hear discussion including answers to the following questions:1. In what area does Java excel beyond other programming languages (esp ones that I know)?2. What do you see will happen to Java in the future?3. How difficult is it to learn compared to PHP (rough estimate)?4. What is the most prominent use for Java, currently?Thanks!

Link to comment
Share on other sites

1. API order... that is, class and function names are much more ordered and predictable. How many times have you had to look up the PHP manual to find out where it was a $needle and where was $haystack? Does it bother you that htmlentities() and htmlspecialchars()'s reverse function is called html_entity_decode() which doesn't follow the same naming convention or that some string functions are called str* while others are called str_*? If so, you'll like the absence of these "problems" in JAVA.2. Not sure, especially now that Oracle has aquired it.3. If you are familiar with all of PHP's OOP features, it's relatively easy. If it was your first language or you didn't know anything about the OOP aspects of PHP, it may be hard to figure it out initially. The development environment setup is the hardest part, but NetBeans makes it trivial.4. Portable desktop and/or console apps it seems. Not so much in web development, though it can be used there too via JSP.

Link to comment
Share on other sites

About (3), the strong typing can also take some getting used to. For (4), it is also worthwhile noting that all Android applications are written in Java.

Link to comment
Share on other sites

Oh yeah... I had forgotten about that... not just Android, but mobile apps in general. Old mobile phones use JAVA exclusively for their apps... well... basic JAVA with various device specific APIs to be exact, but still.

Link to comment
Share on other sites

If you mean "Java Development Environment", Netbeans is a JDE, however there are more specialised JDEs for working with certain platforms.

Link to comment
Share on other sites

Just to respond to question 2: I have my doubts about Java in the future, I mean yeah its fun and great to play with but since Oracle took over sun they have made a few changes I don't really agree with(mainly repackaging everything on the sun website). I saw the ASF has drummed out of working on improving Java so it kind of raises an eyebrow.I think it will always be there though but I also think that Oracle may not be the right company to develop Open-source solutions. I'm not aware of any other open source endeavors they maintained so I wont be surprised if JAVA just became Java EE and Java EE mobile.

Link to comment
Share on other sites

i think learning C# should be best before you start java...though i dont know java...but we are being taught c# first before we start java..and i heared that you need to clear the C# well to get java. i think they are more closer.

Link to comment
Share on other sites

The other way around is also applicable... C# was inspired by JAVA, so the similarities are intended in many cases. Personally, I learned JAVA (alone) first and then C# (at univercity).The official tutorials are nice enough if you overlook the horrible formatting.

Link to comment
Share on other sites

I've noticed people capitalize Java, ie JAVA. Is it an acronym? Also, can Java programs interact with a database of some sort? Most of PHPs power, in my experience, comes from interaction with databases.

Link to comment
Share on other sites

AFAIK, no. JAVA is not an acronym... The official documentation refers to it as "Java"... I guess it's a popular convention in order to make JAVA appear more distinctive from JavaScript. When I see "Java", I'm sort of thinking "Is (s)he confusing Java with JavaScript?", unless I explicitly see something I know to be specific to Java like classes for example. When I see "JAVA" I know with almost complete certainty that the author talks about Java and not JavaScript, and I assume that unless I see something JavaScript specific like innerHTML for example.One teacher of mine said (jokingly of course) that they named it "JAVA" because you could launch the app, get some "java" (i.e. coffee) and by the time you finish it, the app would start :) .Yes, JAVA can interact with databases too, but AFAIK, there's nothing built in. You need to download connectors for the database(s) you wish to connect to and bundle them with your app.... [searching...] scratch that... JavaDB support is built in... hadn't heared of that DB. For MySQL, there's a JDBC connector, JDBC being something similar to PHP's PDO.

Link to comment
Share on other sites

I would disagree that PHP's power lies in its various database APIs. Most server languages do that fairly well. To me, PHP's power lies in the sheer enormity of built-in functions (how many ways can you shake down an array?) and built-in modules that give you everything from XML manipulation to GD graphics and a bunch of stuff I don't even know what it is yet. :)As for Java's power, it probably relies on the installation.

Link to comment
Share on other sites

I would disagree that PHP's power lies in its various database APIs. Most server languages do that fairly well. To me, PHP's power lies in the sheer enormity of built-in functions (how many ways can you shake down an array?) and built-in modules that give you everything from XML manipulation to GD graphics and a bunch of stuff I don't even know what it is yet. :)As for Java's power, it probably relies on the installation.
Yes, PHP has a lot of power in its arrays. But most of the time I use arrays, it is in storing data that is fetched from a database. When I use the GD extension (in complex situations, such as a graph), the data is fetched from a database. Whenever I look at it, everything seems to come down to the database. Of course I haven't gotten into XML, so you, having much more extensive programming experience, including experience in working with XML and other PHP extensions, have a completely different viewpoint.
One teacher of mine said (jokingly of course) that they named it "JAVA" because you could launch the app, get some "java" (i.e. coffee) and by the time you finish it, the app would start laugh.gif .
And he still taught Java? :)
Link to comment
Share on other sites

And he still taught Java? :)
Who said anything about him teaching JAVA? No, he teaches "Computer Graphics" (think Direct2D and the like) in a language agnostic fashion, with JAVA being one of the many languages in which we're allowed to write our "homework"... which reminds me... I still haven't finished mine :) .
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...