Java or JavaScript?

Before i decided to learn Java, I'm confused by the term JavaScript and Java. Aren't they are the same? So I search through google and finally it answered my question. As you can see in the picture above, JavaScript are not equal to Java. They shared some similarity but they are two different things.

Let's start with their similarity
  • Both Java and JavaScript are object oriented programming languages (What is OOP language?)
  • Both work within HTML documents, but in different ways (will explain later)
  • Both were created by big computer companies about 15 years ago
    • Java created by James Gosling of Sun Microsystems.
    • JavaScript was created by the fine people at Netscape.

What differences between them?
  • They work with HTML in different way. Java can stand on its own while JavaScript must be placed inside an HTML. 
    • JavaScript program is actually part of the HTML document, with the language written directly into the code of the document.
    • Java programs are standalone and the HTML document simply serves as a home for the program. 
  • They also different in  how the language is presented to the end user
    • Java must be compiled into what is known as a "machine language" before it can be run on the Web. Once the Java is compiled, it is set. If you need to edit the code, you need to go back to the original text and alter it, but then you need to compile again.
    • JavaScript is text-based. You write it to an HTML document and it is run through a browser. If you need to do some editing, simply go into the HTML document and change some code.

Both of these two codes can create great website with interactive features. But the reason I choose to learn Java instead of JavaScript is because Java offer more than JavaScript. JavaScript are limited by constraints of the HTML document in which it is embedded. On the other hand, Java offer more possibility and all sort of amazing application can be done by it. Besides, it is a more challenging language, I like challenges. : )

References:
http://www.javabeat.net/tips/190-java-vs-javascript.html
http://www.htmlgoodies.com/beyond/javascript/article.php/3470971/Java-vs-JavaScript.htm

No Response to "Java or JavaScript?"

Post a Comment

Related Posts Plugin for WordPress, Blogger...