Wednesday, October 16, 2013

Java is to JavaScript as Car is to Carpet - a Beginner's Guide

Some recent discussions at work have led me to the surprising realization that lots of people working in IT don't understand that Java and JavaScript are almost completely unrelated to each other. This is actually a fairly important misunderstanding to correct:  it leads to wasted troubleshooting efforts, such as downgrading or upgrading Windows Java installations in response to browser JavaScript errors.

I found the title of this blog entry in a StackOverflow post: "Java is to JavaScript as Car is to Carpet". That's pretty much it, in a nutshell. For the record, the only things that Java and JavaScript have in common are:
  1. They are both programming languages.
  2. The word "Java".
  3. Both came out of the web technology explosion of the early 1990s.
  4. Both are frequently encountered in the context of web browsers.
Java is a compiled programming language that was originally developed with a major goal of allowing similar or identical codebases to run on different platforms without needing to be recompiled. It does this by compiling to "bytecode" rather than platform-specific machine code, which then typically runs inside a so-called "Java Virtual Machine". Java was originally developed and controlled by Sun Microsystems (now Oracle), but it has since been re-licensed under the GNU Public License. Numerous open-source Java implementations now exist, but the Oracle/Sun version is still the most familiar to the average user.

Java is associated with the web browser experience because of the widespread use of Java "applets" that are embedded in browser windows. Applets are not technically part of the browser; the compiled Java bytecode is downloaded by the browser and executed in a Java Virtual Machine (JVM) as a separate process. Applets are frequently transferred as a compressed "Java archive", or JAR file. Applets downloaded by a browser do not necessarily need to run in a browser window, but the fact that they are frequently embedded there leads to some confusion.

Neither is Java necessarily a client-side technology: many popular server-side applications are written in Java and execute in a server-side JVM. Google's Android platform extends things even further, using Java as the programming language but compiling the bytecode to execute on their own proprietary virtual machine.

JavaScript, on the other hand, is an interpreted (i.e., non-compiled) programming language that was originally developed to run inside web browsers. It was developed at Netscape and was later adopted by Microsoft and standardized as "ECMAScript". The use of "Java" in the name "JavaScript" was probably an attempt to piggyback on the popularity of Java; the two languages have almost nothing in common from a technical perspective.

JavaScript is most frequently used to control the web browser experience, but there are many projects that use JavaScript completely outside the browser. My first experience with this dates back to the late 1990s, when I used a JavaScript-based commercial tool to automate software deployments to Windows workstations. Today, there are many interesting non-browser-embedded JavaScript platforms, such as Node.js and PhantomJS.

18 comments:

myName said...

Nice post. Thanks for sharing, I knew the difference already but I was still asking myself how the names ended up sharing the word Java.

Hans Brinkhof said...

They are both programming languages.

Actually, since JavaScript code doesn't need to be compiled in order to run, it's considered to be a scripting language, rather than a programming language.

Melbourne Web Developer said...

I am very much pleased with the topic you have chose for. I enjoyed every little bit part of it.

Pawel Co Faddey said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

ASO Services said...

There are so many useful information in your post, I like it all the time. And I want to share this boost app ranking with you, you can take a look. This is very useful.

lettyharry said...

It is worthwhile reading this blog. I was searching such kind of blog for a long time but now I think I got a blog of my interest. I am thankful for these all suggestions mentioned under this blog.
Pepperstone Forex โกง

heryy smith said...

Sometime few educational blogs become very helpful while getting relevant and new information related to your targeted area. As I found this blog and appreciate the information delivered to my database.
เรียน igcse

Blog Comment Backlinks said...

Fantastic blog you have here. You’ll discover me looking at your stuff often. Saved! The Top Cleaner

Praylin S said...

I am really glad that I came across your blog. This blog is worth reading. I am new to Java, but still, I was able to understand the concepts. Keep updating. This'll be of great help to me. Regards.
Javascript Training in Chennai | Javascript Training Classes | Javascript Course in Chennai | Javascript Training

Calla said...

Found your post interesting to read. I can't wait to see your post soon. Good Luck for the upcoming update. This article is really very interesting and effective.
php training institute in Mumbai

Vicky Ram said...

Keep sharing this kind of worthy information. I really enjoyed reading your article.

Article submission sites
Technology

sheela rajesh said...

I have to appreciate you for your great work which you had done in your blog.i want you to add more like this.
JAVA Training in Chennai
JAVA Course in Chennai
Digital Marketing Course in Chennai
Python Training in Chennai
Big data training in chennai
Selenium Training in Chennai
JAVA Training in Chennai
JAVA Course in Chennai

ProPlus Logics said...

Hey Nice Blog!! Thanks For Sharing!!!Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
SEO company in coimbatore
Digital Marketing Company in Coimbatore
SEO Services in coimbatore

Aruna Ram said...

Hi! I was much time to spend your post, it is very impressed to me. so I am regularly following your post. I would like more ideas from your blog...
Primavera Training in Chennai
Primavera Course in Chennai
Corporate Training in Chennai
Embedded System Course Chennai
Oracle Training in Chennai
Tableau Training in Chennai
Spark Training in Chennai
Excel Training in Chennai
Power BI Training in Chennai

Vicky Ram said...

Nice post. I learned some new information. Thanks for sharing.

Guest posting sites
Education

Vicky Ram said...

Good explanation with appropriate solution.

Guest posting sites
Education

anusha said...


data science training in chennai Data Science Training in Chennai with real time projects. We are Best Data Science Training Institute in Chennai. Our Data Science training courses are taught by Experts.

Anbarasan14 said...

This was an well written blog. The admin has really shared a very useful content in a clear way. Thanks for sharing.

IELTS Classes in T Nagar
IELTS Coaching In Velachery
IELTS Coaching in Tambaram
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
English Speaking Classes in Mumbai
IELTS Coaching in Chennai
IELTS Classes in Mumbai