Skip to content
themooserooster edited this page Nov 25, 2014 · 8 revisions

JavaScript

JavaScript is ubiquitous - it's everywhere! Once known as the language that ran in web browsers, while still true, recent efforts on the part of Google, with their V8 Engine, and the fellows responsible for Node.js, have increased the performance of JavaScript and taken the language out of the browser toward wider application. This means you can write entire apps in JavaScript, from backend to front end, with your whole team speaking the same language!

There's a lot of information on the Internet concerning writing JavaScript apps, here's some execellent resources from from Mozilla, developers of the FireFox web browser:

JavaScript® (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions, most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.

In fact, the Mozilla documentation on JavaScript is an excellent source for instruction on learning JavaScript and for quick references to API.

Here's a bit of the history behind JavaScript:

JavaScript is the world's most popular programming language. Why? Because every web browser in the world comes pre-packaged with a JavaScript interpreter.

First thing to know about JavaScript: It has no relation to the Java programming language/plugin/runtime environment. At all. Besides the name. About that...

So JavaScript was invented by a really smart guy named Brendan Eich, who was working at Netscape Communications Corporation in 1995. Netscape had basically invented the web-browser and gotten the jump on Microsoft, who had been too busy taking over the world to notice the whole World Wide Web thing. But they were catching up. Fast.

One thing missing with Netscape's web-browser, Netscape Navigator, was any sort way to program complex behavior on a web page, which meant the the web was dumber than a box of hammers. Every little thing you did on a page meant the browser had to refresh the entire page to change even the tiniest thing on it. Adding something to your shopping cart on a website? Refresh. Updating football scores? Refresh. And that was slow. And annoying. And meant that you had to stare at a blank, reloading page all the time. On 56k. If you were lucky.

So the race was on to put a programming language in the web browser. Microsoft had been pretty quick to bust out a web browser, calling it Internet Explorer. They had also released a family of programming languages called Visual Basic (VB) and Visual Basic Script (VBScript) for programming Windows applications, and word on the street was that they were planning to build those into IE.

In 1994 Sun Microsystems had come up with this programming language called Java, and different versions of a program called a Virtual Machine. Each operating system would have a different version of the Java Virtual Machine (JVM) made just for it, but after that, the Java code that you wrote for a program would perform exactly the same across all operating systems. You could write a program once and have it run on Mac and Windows and Linux more or less the same. Sounded pretty genius.

So when Netscape felt Microsoft nipping at their heels, the made fast allies with Sun Microsystems in order to put Java in Netscape Navigator as a sort of pre-emptive answer to Visual Basic. But MS still had VBScript, which was a lighter, easier weekend-warrior kind of programming language. Which brings us back to Brendan Eich.

While the suits upstairs were hashing out the Sun-Netscape Alliance, Eich was tasked with coming up with a second, more "light-weight" language that could ship with the upcoming Netscape Navigator 2.0. In 10 coffee-drenched days he took several ideas from some of his favorite but mostly snubbed languages, mixed them together with a little bit of the ever-popular C language, used NONE of the Java language, and came up with something he called Mocha. But that wasn't confusing enough. So then it was renamed LiveScript. And then the Sun-Netscape deal went through and the suits made him call it JavaScript. Even though it had nothing to do with Java.

So when Netscape Navigator 2.0 was released in early 1996, it shipped with JavaScript and Microsoft was so left in the lurch, that they had to throw in the towel and reverse-engineer JavaScript just so that IE could properly run webpages written for the then-more-popular Navigator.

Here's a few important links within the Mozilla documentation:

© 2014-2015 Operation Spark

Clone this wiki locally