What is the exact difference between Java and Javascript? Well they are both very similar, but it depends on what you are using them for and what your preference is when it comes to programming.
First, java is an Object Oriented Programming or (OOP) created by James Gosling of Sun Microsystems. Javascript is a scripting language created by Netscape and used to be called Livescript. Both languages are distant cousins of each other, and both are OOP languages. Javascript is just less complex and contains simpler commands. It is overall easier for the average programmer to understand.
So what does OOP mean? It is actually relatively new term and means the sum of the parts of a program that make up the whole. An example would be like a car. First you have the engine and many other parts. Each part plays a vital role in creating the whole car. You need the engine, the seats, doors, etc. Without every part, the car will not work. Both java and javascript are like this, they have several parts that make the language and the program that is made, using either java or javascript. The most important part is that each part is in its own class, meaning you can't just mix stuff. Just like you can't have the steering wheel on the engine of the car, the same goes for java and javascript. There are a certain class of parts that go together to make the whole product. So the main point here is that when using these languages, you must use several classes of commands to create the whole program or operation that you're trying to accomplish.
First, java is an Object Oriented Programming or (OOP) created by James Gosling of Sun Microsystems. Javascript is a scripting language created by Netscape and used to be called Livescript. Both languages are distant cousins of each other, and both are OOP languages. Javascript is just less complex and contains simpler commands. It is overall easier for the average programmer to understand.
So what does OOP mean? It is actually relatively new term and means the sum of the parts of a program that make up the whole. An example would be like a car. First you have the engine and many other parts. Each part plays a vital role in creating the whole car. You need the engine, the seats, doors, etc. Without every part, the car will not work. Both java and javascript are like this, they have several parts that make the language and the program that is made, using either java or javascript. The most important part is that each part is in its own class, meaning you can't just mix stuff. Just like you can't have the steering wheel on the engine of the car, the same goes for java and javascript. There are a certain class of parts that go together to make the whole product. So the main point here is that when using these languages, you must use several classes of commands to create the whole program or operation that you're trying to accomplish.
Now for how they differ. The main difference is that java can stand on its own when programming. Where as javascript must be placed inside an HTML document to function. Java can create standalone applications, and is very powerful for applications. Javascript has to be fed into a text browser to function. Java is also used in mobile devices and does not require HTML to function. So it is really about opinion and preference. Java has slightly harder operations, and javascript just has extra steps to do some functions that java can do on its own.
Javascript's main benefit is that it can be understood by the average human. It is generally more forgiving than java. Java requires every action to be denoted and spelled out correctly down to the smallest details. Javascript is geared to making web pages, while java is used mostly where it is really required for something to run. In conclusion, both languages are great for making a computer do some very cool actions. Both will create awesome web pages, both can also offer the user the opportunity to interact with a webpage. But java and javascript were by no means created equally. Just like all the other languages for programming, each language was made with a certain special skill that another language can't do as well. So it all comes down to preference and what language suits you best.
References:
http://www.javatpoint.com/images/javascript/javascript_logo.png
http://www.htmlgoodies.com/beyond/javascript/article.php/3470971
http://blog.newrelic.com/wp-content/uploads/javalogo.png
No comments:
Post a Comment