So… what is the difference between Java and JavaScript anyway?

Posted: November 30, 2011 in programming, technology
Tags: , , , , , , , , ,

They are both similar and yet different depending on how you look at them.

First Their Lineage

Java is an Object Oriented Programming (OOP) language created by James Gosling of Sun Microsystems. JavaScript is a scripting language that was created by Netscape and was originally known as LiveScript. JavaScript is a (very) distant cousin of Java, in that it is also an OOP language. Many of their programming structures are similar. However, JavaScript contains a much smaller and simpler set of commands than does Java. It is easier for the average weekend warrior to understand.

The Sum of the Parts Makes the Whole…

You may be wondering what OOP means by now. Object Oriented Programming, whereas the sum of the parts of a program make up the whole. Think of this way: you are building a model car. You build the engine first, it can stand alone, it is an engine and everyone can see it’s an engine. Next you build the body, it can also stand alone. Finally, you build the interior including the seats, steering wheel, etc… Each element is an object, but it is not a fully functioning car until all the pieces are put together. The sum of the objects (parts) make up the whole.

Continuing with the model car example, when you built the engine, you didn’t use any of the parts that would later build the seats (a 350 four-barrel engine with a seat belt sticking out if the piston would look pretty silly). The point is that all the parts that made up the engine were of a certain class of parts. They all went together. Same goes for the body and the interior.

The point is that in these languages, you build objects out of classes of commands to create the whole. Understand the terminology? No…

Java and Javascript are similar like Car and Carpet are similar.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s