Java and JavaScript

I was sitting in a meeting and there was a bit of confusion about whether the specification called for Java or JavaScript.

When I asked about which one it was, I got this amazingly hysterical answer.

“Java or JavaScript? Doesn’t matter, it’s really the same…”

Yowza.

Allow me to clarify, in case you find yourself locked in a room with people who speak only in buzzwords and really have no idea what they are talking about.

Java is a programming language written in 1995 by James Gosling. The dream was that it would be a “write once, run everywhere” language. It runs on a Java Virtual Machine, and it’s hugely popular to teach on college campus.

Also, there are like a billion unemployed Java developers.

Let’s take a look at “Hello World” in Java.


class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Prints the string to the console.
    }
}

Classes, Public, Static, void,…. it’s not for the casual relaxing day of coding by the beach.

JavaScript has nothing in common with Java. It is a completely different language with a similar naming.

Programs in JavaScript are called scripts. They need no compilation, you just write a script, append it to HTML-page and it works.

Let’s take a look at “Hello World” in JavaScript.

<script> 
      alert('Hello, World!') 
</script>

Really simple, and runs in most every browser.

Oh yeah, and they are NOT THE SAME.

Author: heinrich

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.