Explaining The Header

July 31, 2013 by Christopher Walker

Code

Just in case the header changes and for historical reasons, the code in question is this:

    var adjectives = ["shiny", "outstanding", "marvelous", "extraordinary"];
    var some = function (str) {
        for (var i = 0; i < adjectives.length;i++) {
            str += adjectives[i].slice(0, 1);
        }
        return str + " ";
    };
    var greet = (function() {
        return "Welcome to " + some("") + adjectives[0] + new Object();
    })();
    console.log(greet); // Welcome to some shiny [object Object]

The programming language used in my header picture or the above code block is JavaScript. JavaScript is by far my favorite and most proficient language. I have been using it since around 2002. JavaScript has a pretty long (and interesting) history in terms of its perception in the development community.

History Time

###The Birth

JavaScript was written by Brendan Eich in 1995, while he worked for Netscape Communications, the company most known for their creation of the famous FireFox browser after they split up and became Mozilla. Back then, they were the creators of the Netscape Navigator browser. JavaScript was a product of what was known as the browser wars.

During this era, features began emerging in the two main competing browsers, Netscape’s Navigator and Microsoft’s Internet Explorer. These features attempted to draw developer’s attention towards their in house browser products to develop sites for that browser, thus driving up its usage by the web enabled community. Netscape’s answer to the browser war was a client-side language called LiveScript that would combine with another server-side language that would assist in creating rich websites and web applications. Due to the hype of the Java programming language at the time, the name was changed in a later version of Netscape’s browser to JavaScript. While the browser wars continue today, there are plenty more competitors (Chrome, Safari, Opera) and there are (probably) less lawsuits (unless you are talking about the mobile browser wars).

JavaScript is not Java

If attempting to understand anything about the JavaScript language, this single aspect is key. JavaScript IS NOT Java. While they both maintain the basic C-styled syntax, that is about the only thing they have in common. Let’s break it down to certain aspects in how they differ:

Java vs. JavaScript
_Java_ _Java_Script
  • [Strongly typed](http://en.wikipedia.org/wiki/Weak_typing)
  • Compiled into bytecode
  • Classical OOP
  • Does not run in browser natively
  • Oracle/Sun Microsystems
  • Capable of threading
  • C-styled syntax
  • [Weakly typed](http://en.wikipedia.org/wiki/Weak_typing)
  • Interpreted
  • Prototypal OOP
  • Runs in (most) browsers natively (out of the box)
  • Mozilla (originally)
  • Works in a single thread (unless you use HTML5's API for Web Workers)
  • C-styled syntax. Semi-colons are "optional".

As you can see, about the only thing they have in common is the aforementioned C-styled syntax and the word “Java”.

The Changing Tide

When JavaScript first came out, it was thought of as a toy language; a language for making fancy animations, or mildly interactive content on a web page and nothing more. Still, the development community around JavaScript grew rapidly. So much so that in 1996, Microsoft released a new version of Internet Explorer that incorporated it’s own interpretation of JavaScript, with a few changes. These changes created quite a clamp on development in JavaScript as now, developer’s had to “sniff” which browser their JavaScript program was being executed in. The sniffing process was:

  1. Complex
  2. Unreliable (users could spoof their browser)
  3. Added a lot more code to a language that was initially intended to be simple.

<side-rant>

Whenever you hear a web developer complain about Internet Explorer, it is because that Microsoft consistently went against common practice when developing Internet Explorer up until the most recent version, IE10. Versions 6 through 8 and even a little bit of 9 of the Internet Explorer browsers were complete standards catastrophies. As new browsers emerged (Chrome and Safari) or became more noticed (for the Opera readers), developing consistent sites across each one became a headache. When you added the standards nightmare that Internet Explorer introduced, it was enough to make grown men cry.

</side-rant>

A major win for JavaScript happened when it was submitted and accepted by the ECMA for industry standardization. This created a base standard for the language (and also gave JavaScript a new name of ECMAScript…but we still call it JavaScript). Since 1997, ECMA has helped to standardize new features. The current version of JavaScript is ECMAScript 5.1. ECMAScript 6 (or ECMAScript Harmony) is not yet released, but is due soon.

JavaScript on the Server

As the language matured (along with it’s developers), it began to see other uses besides the browser. Microsoft released a language API for writing native Windows scripts in the language under the Windows Scripting Host, giving system administrators a choice between VBScript and the Microsoft implementation called JScript. Perhaps the biggest use of JavaScript outside of the browser is a server-side technology called Node.js.

Node is a server-side language, meaning it runs on the server rather than on the client (explaining this may come up in a future post as some people have a hard time understanding what that means). Node runs off of Google Chrome’s JavaScript interpreter called V8. It was released in 2009 by a developer named Ryan Dahl. While Node.js is probably the most popular implementation of a server-side JavaScript technology, it is not the only one out there. A community in support of server-side JavaScript started in 2009 (around the same time as Node) called CommonJS. To learn more about that if you have an interest visit their wiki site.

The Future

No blog post about the history of JavaScript can skip the importance of this language. JavaScript is one of the most used languages today. At the time of writing, JavaScript sits at the top of GitHub’s top languages at 21%. JavaScript development is one of the most sought for qualifications by software development companies. Even StackOverflow.com, a major Q&A site for programmers, has well over 410 thousand questions for JavaScript alone. The popularity of JavaScript has grown so much that the co-founder of StackOverflow.com and the entire StackExchange network, Jeff Atwood, coined a law called, approriately, Atwood’s Law, stating that “any application that can be written in JavaScript, will eventually be written in JavaScript.”

The future of JavaScript is promising and I am glad. Not only is it a fun language to work in, it’s also very easy to understand the basics of how it works. This opens up the door for many new and exciting technologies to be wrapped up with JavaScript. Just look at the rapid development of web applications today. You can do just about anything in the browser, all thanks to one language, JavaScript.

Summary of the history of JavaScript

  • Created in 1995 by Brendan Eich
  • People were like WTF is this?
  • Got big quick
  • Microsoft screwed it up
  • A standard was created
  • Everyone loves JavaScript now
  • Atwood’s law
  • Server side JavaScript FTW!
  • Possibility your household electronics now run JavaScript

Privacy Policy

© 2017 | Powered by Hugo and lots of motivation.