View Full Version : Started java...quick question about what it can do....
sushi4664
07-23-2007, 07:47 PM
I started to learn java (i took a class at school)...its great and everything...but I still have not gotten what it can do...
The biggest thing with java is that its platform-independent...but so is php isnt it?
I am trying to figure out what Java can really do that other programing languages cannot do...
brad211987
07-23-2007, 11:05 PM
I am trying to figure out what Java can really do that other programing languages cannot do...
In my opinion, it really comes down to personal taste. You can do pretty much whatever you can cook up in your mind, in about any language. The real focus is more on the "how" you do it. Java is an object oriented language, and that is going to dictate a lot of how you do things in java, as opposed to something like C.
My advice would be to experiment in other languages as well as java, and see what you like and are comfortable in. More importantly, make sure to understand the underlying programming concepts behind what you are doing, as this will transfer to any language.
There is more to Java than meets the eye. If you learn how to program in Java, than you would be able to create applications to run in client/server applications as well as mobile devices such as PDA, Mobile phones, among others.
PHP is a scripting language that has been designed specifically to run on a server machine. Whilst Java's been designed to run on a server side technology as well as a client side machines. Therefore, if you really want to compare PHP to Java....then you should at the least note what you can achieve in PHP over Java, and/or the other way around.
The true power of Java can be appreciated once you have started to build large scale enterprise applications where you would be able to share resources between multiple machines etc.
Whilst a lot of people would argue that scripting languages such as PHP, Python, Perl, and even JavaScript (well, JavaScript is OS independent, but it isn't browser independent) are platform independent, as a programmer in these languages, you will need to be aware of the many differences between various OS platforms in order to create applications that are truly OS independent.
With Java, OS independence is almost guaranteed, given that the language was built to work independently from the ground up...and it was not something that people thought of once the application was released and used in the market place.
For example, in PHP...there are well known issues in terms of backward compatibilities between various releases of PHP such as version 3 and 4. That is to say that some applications that were originally written to run in a PHP3 environment, sometimes require some sort of a re-write in order to run in a PHP4 environment. In Java, this is not a case for a concern, and updating one's project from one version to another is way simpler than is the case in PHP.
In Java, this is not an issue and in actual fact, you can decide the version of Java you wish to compile your application at any point whilst compiling your project.
Not to say that PHP is not a good programming language. Personally, I program in both PHP and Java...among other programming languages. I think PHP is great for small to medium size projects when programming web applications. If you are planning to build an enterprise application, I am sure that you will find Java is much more superior to PHP.
Personally, I think that PHP enjoys a great deal of support in the open source community and this is probably why it is so popular in creating web applications.
In summary, ANYTHING you can do in PHP...you can do in Java...but NOT EVERYTHING you can do in Java...you can do in PHP...and that is why I would recommend that you learn Java before you learn PHP.
In any case, if you learn Java....it is much easier to learn other languages such as C#, J#, etc...specially those languages that come from the C family of programming languages including C++
Some links
the following link shows a benchmark between Java and PHP
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=php&lang2=java
here is a good site that compares PHP with Java
http://www.julianonsoftware.com/?p=1227
Cheers,
Ess
altie
08-16-2007, 08:17 PM
Almost any language in general use will be Turing complete, meaning roughly that it can perform any practical computational task. One of these languages can emulate any other. Java is Turing complete. In that sense, Java can do lots of things.
That leaves out a lot, though.. Every language has goals, pros and cons, targeted scenarios and a community that all have a huge influence on what the language is really useful for. Java is a very general purpose language, so it doesn't tend to make one programming task easier at the expense of any others. This is one reason it's a good choice for a first language. The specification of an intermediate language and runtime environment is one of the few things that makes it stand out, less so now that .NET languages use a similar architecture.
Does that help?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.