Java and JavaScript

June 26, 2017

Java and Javascript

What's the deal with Java & JavaScript?

“Yeah I’m familier with Java, and how should I get started with the JavaScript now?” This is the concept that most of the peoples have while they are introduced to the programming language Java. The similarity in the name is the main reason for misconception of both Java and JavaScript being from same ‘family’ keeps revolving around beginners in computer programming field. Then “why the similar name?”, we’ll come to this part in a while.

First, what is Java & JavaScript?

Java is a programming language and computing platform created by the Sun Microsystem in 1995. It is a class-based, object-oriented compiled language that can run in various platforms (i.e. desktop computers and mobile devices). Meanwhile, JavaScript is a scripting language developed by Netscape Inc., considered as a vital component of the web.

Scripting language is a programming language that supports scripts i.e. the language can support a program that are written for a special run-time environment to automate the execution of tasks which would otherwise are required to be executed one-by-one by human operator. This languages are often interpreted rather than compiled which makes them easier to implement and are more dynamic.

Java and JavaScript both are OOP languages. Although most of the programming structures are similar in both languages, Java and JavaScript are very distant in terms of relationship among them. In comparison, JavaScript contains simpler and samller set of commands than Java, and is easier to learn for beginners.

What's in the name?

The naming of the JavaScript is more to do with the political and marketing strategy. Originally, when after it was created (in May, 1995) it was named Mocha. In September of 1995, the name was changed to LiveScript, and to JavaScript after receiving trademark from Sun(now Oracle) in December of same year. The reason for the license agreement on the name by Netscape and Sun was to make it a complementary scripting language to go with Java, with the compiled language.

“The language’s name is the result of a co-marketing deal between Netscape and Sun, in exchange for Netscape bundling Sun’s Java runtime with their then-dominant browser.” - Wikipedia

For the brief history of JavaScript you can visit this site. Thus, to compare Java and JavaScript on the basis of their names is like comparing ‘Can’ and ‘Canteen’ upon how they sound.

Java vs. JavaScript

Despite of similar name JavaScript is not a part of the Java platform. The main difference between them is that Java a stand-alone language while JavaScript must be placed inside a HTML document to funciton. A Java creates ‘applet’ that is a fully contained program. JavaScript resides within HTML documents, and can provide level of interactivity to web pages that are not achiveable with simple HTML.

Some key differences betweeb Java and JavaScript:

  • - Java is an OOP programming language while Java Script is an OOP scripting language
  • - Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only
  • - Java code needs to be compiled while JavaScript code are all in tex

Java is also used on the web on both the server side and client side (as applets). It is like a full-packaged programming language that can be used for everything from back-end serve to graphical desktop applications. JavaScript is blended into web pages while Java is geared towards where it is needed most at a time. Even though they’re not created equally by any means, both can create and offer users with the interactions with your web pages.

In the conclusion, it comes to your need to choose between these two or any other languages for your programming tasks. Lots of applets as fully functionig items, and JavaScripts are handed out in net for acheving specific set of tasks. So, my suggestion is to play with resources that you find interesting or need to operate specific task as per your need in your projects.