Thursday 25 July 2013

What is JavaScript? What are the key difference between Java and JavaScript? What are the advantages and disadvantage?


In this article I will explain what is JavaScript? What are the key difference between Java and JavaScript? What are the advantages and disadvantage? What is JavaScript?

JavaScript is a scripting language designed primarily for adding interactivity to Web pages and creating Web applications.

JavaScript is one of the most simple, versatile and effective languages used to extend functionality in websites. Uses range from on screen visual effects to processing and calculating data on web pages with ease as well as extended functionality to websites using third party scripts among several other handy features, however it also possesses some negative effects that might make you want to think twice before implementing JavaScript on your website. Let's look at some of its pros and cons.


Difference between Java & JavaScript

Listed are key differences between the Java and JavaScript.

  1. Java is an OOP programming language while Java Script is an OOP scripting language.
  2. Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only.
  3. Java code needs to be compiled while JavaScript codes are all in text.
  4. They require different plug-ins.
JavaScript is widely supported. It is available in the following browsers:
  1. Netscape Navigator (beginning with version 2.0)
  2. Microsoft Internet Explorer (beginning with version 3.0)
  3. Firefox
  4. Safari
  5. Opera
  6. Google Chrome
  7. Any other browser whose vendor licensed or implemented JavaScript.
Thus, most Internet users today have browsers that support JavaScript. That's why JavaScript is one of the most popular tools in the Web developer's arsenal.

Advantages
  • JavaScript is executed on the client side
    this means that the code is executed on the user's processor instead of the web server thus saving bandwidth and strain on the web server.
  • JavaScript is a relatively easy language
    The JavaScript language is relatively easy to learn and comprises of syntax that is close to English. It uses the DOM model that provides plenty of prewritten functionality to the various objects on pages making it a breeze to develop a script to solve a custom purpose.
  • JavaScript is relatively fast to the end user
    As the code is executed on the user's computer, results and processing is completed almost instantly depending on the task (tasks in JavaScript on web pages are usually simple so as to prevent being a memory hog) as it does not need to be processed in the site's web server and sent back to the user consuming local as well as server bandwidth. 
  • Extended functionality to web pages
    Third party add-ons like Grease monkey enables JavaScript developers to write snippets of JavaScript which can execute on desired web pages to extend its functionality. If you use a website and require a certain feature to be included, you can write it yourself and use an add-on like Grease monkey to implement it on the web page. 
Disadvantages
  • Security Issues
    JavaScript snippets, once appended onto web pages execute on client servers immediately and therefore can also be used to exploit the user's system. While a certain restriction is set by modern web standards on browsers, malicious code can still is executed complying with the restrictions set.
  • JavaScript rendering varies
    Different layout engines may render JavaScript differently resulting in inconsistency in terms of functionality and interface. While the latest versions of JavaScript and rendering have been geared towards a universal standard, certain variations still exist.
    Website Usability Consultants all over the world make a living on these differences, but it enrages thousands of developers on a daily basis.

1 comment:

  1. Thanks for the above tutorial. I read your article. Actually I missed my class on the day of this topic. Now I got all the details by your post. Thanks for helping me. All the details are mentioned in a very good and simple way.
    digital signature Adobe Reader

    ReplyDelete