Everybody uses it. Everybody. When you use Facebook, you’re using JavaScript. When you post a tweet, you’re using JavaScript. Indeed, when you visit MakeUseOf, you’re using JavaScript. There are very few websites which don’t use it.

But few people know what it really is, and how it works. Many are unaware of the long and fascinating history of JavaScript, and what you can do with it.

As it turns out, JavaScript is amazingly powerful, and endlessly fascinating.

History of JavaScript

In the beginning, the Web wasn’t very interesting.

Back then, there was only HTML. Web pages were nothing more than words, links and pictures. There was no dynamicity. No excitement. Everything was just… Static. The Internet had to evolve. And thus, at the offices of Netscape in 1995, JavaScript was born.

Back then, the browser race was hotly contested between two players. The first was Netscape, with their dominant Navigator product. The other was the upstart Internet Explorer, by Microsoft. Both companies had seen the massive potential of the Internet, and were trying to create the browser which would thrust it into the mainstream.

Netscape wanted to create a programming language that was both easy to grasp for non-beginners, but would also allow the developer to exercise a greater control of what happens within the browser window.

But despite the name, it’s important to stress that JavaScript has nothing to do with the popular Java programming language originally created by Sun Microsystems. Indeed, it was originally called LiveScript (and internally named Mocha), before being renamed in order to capitalize on the success and popularity of Java.

It’s worth noting that JavaScript wasn’t the first web scripting language. An earlier web browser, called ViolaWWW, contained a rudimentary scripting language, and a precursor to CSS. However, it never really caught on, and its scripting language never really became a standard.

One year after the release of JavaScript, Microsoft ported it to Internet Explorer. In the years since, it has became one of the essential building blocks of the web, and is found on almost every website, and is supported by almost every web browser.

JavaScript also enjoyed further success as a language for website, application and mobile development. We’re going to talk about this later, but first, let’s have a look at the one of the most significant JavaScript web projects, jQuery.

jQuery

JavaScript was built with the aim of being non-threatening to non-professional programmers. But despite that, came with some inherent challenges to journeymen developers.

Perhaps the biggest was the cross-platform nature of the web. There are countless browsers in use – Firefox, Internet Explorer, Chrome, Opera, and Safari, to name just a few. Each of these interpret JavaScript in subtly different ways, and have varying levels of support for certain language features.

This meant that developers had to write more and more complicated code, just to ensure their websites worked across all versions of all popular browsers.

The answer to this issue was jQuery.

Launched in 2006 by John Resig, jQuery fundamentally changed how people write JavaScript by standardizing and simplifying certain browser interactions and animations. For the first time, developers could write their code once, and have a measure of certainty it would work across all browsers.

Crucially, jQuery also made it simpler to write JavaScript, by replacing the original, clunky, verbose facets of the language with something that was significantly more sleek and elegant.

Node.js

JavaScript can flourish outside the web browser. If you need any proof of that, just look to Node.js.

Launched in 2009, Node.js is a free, open-source, cross-platform toolkit for the creation of high-performance server-side applications, such as web servers and applications. In the years since it was launched, it has been adopted by thousands of developers and companies, including Groupon, LinkedIn and PayPal.

What makes Node.js so special is its speed, and its expansive community of developers who contribute code and modules.

Beneath the hood of Node.js is the Google V8 engine, which also powers the Google Chrome browser. This is one of the driving factors behind the runaway success of Node.js, as it allows for the interpretation of JavaScript code at breakneck speed.

There are also thousands of Node.js modules which are created by its expansive ecosystem of developers expand its basic functionality. These tend to be distributed by NPM, or the Node Package Manager. This is a free, command-line app which integrates perfectly with the Node.js runtime, and allows you to integrate third-party JavaScript libraries into your own code.

But as often is the case in the JavaScript world, there are third-party alternatives that make writing mobile applications significantly quicker and easier. These include PhoneGap, Titanium, Sencha, and Ionic, all of which allow you to write an app once, and be assured it will work on a variety of mobile platforms. Although, it’s worth adding that depending on how you use them, they can come with pretty hefty price tags.

CoffeeScript

CoffeeScript drastically simplifies the process of writing JavaScript by allowing you to write in a more straightforward ‘dialect’ of the language which is compiled (or, converted) to standard JavaScript.

The most compelling feature of CoffeeScript is that it permits you to write JavaScript, whilst avoiding some of the rougher parts of the language. Despite its overall ubiquity, JavaScript has received a fair deal of criticism as a result of its various idiosyncrasies, which are likely a product of being designed in only ten days.

It accomplishes this with a syntax which strongly resembles Python and Ruby (two languages known for their ease of use and readability). The CoffeeScript compiler also enforces good coding standards which make your code simpler to read by other developers.

CoffeeScript isn’t the only language which exists to skirt around the roughness of JavaScript. Also worthy of your consideration is Typescript, by Microsoft, and Haxe.

Conclusion

JavaScript is big. Really, really big.

Because really, when we talk about JavaScript, we’re not just talking about the language. We’re talking about one of the members of the Holy Trinity of the Internet. We’re talking about the plethora of projects, libraries and programs which have spawned around it, and have enjoyed their own runaway successes.

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

Comment

Name *

Email *

Lucas

February 18, 2015 at 4:38 am

Don't run out of mimagination dear Matthew. Besides JS is today's standard it doesnt mean gonna last forever. In fact Google has been working in a... redefined scripting not quite popular but there in the shadows waiting to jump over as a wild animal. Ask M$ they're kinda hunter

Javascript is the worst thing about the internet. Most sites load in 10% of the time when Javascript is disabled. Its an albatross around our online necks. A good website works without Javascript, albeit with less features. Most of those features are pointless ads anyway.

"Most of those features are pointless ads anyway."
To you they may be pointless but to MUO, and other sites, it is their life blood, or so they claim.

In an article in this morning's USA Today website publishers are bemoaning the fact that people are clicking on less ads and, when they do click on a link, they spend less time looking. Website publishers are trying to figure out how to extend the "linger time" of clickers.

Java is not a company. Java was a programming language (a "virtual machine," which runs programs written in Java) created by James Gosling and owned by Sun Microsystems, which was later bought by Oracle.
Java is installed on millions of devices; for example, the interactive features on Blu-Ray movie disks can be created in Java, and Java games (like Tetris or Pac-Man) can be played on "feature phones" that do not have the capabilities of smartphones.
You may have heard about the recent patent trial between Oracle and Google, over Google's use of a few lines of code; in short, many Android apps run in a version of Java, the Dalvik virtual machine, which is compatible with Oracle's Java, but was written by Android, Inc and Google.
Security flaws in several versions of Java led to, among other things, 600,000 Macintosh computers being infected with a trojan; many Web servers hosting webpages use Apache Tomcat to run Java programs (servlets and JavaServer Pages) on websites. Major corporations use Java on a daily basis on their computer networks. Novell NetWare 6 used Java to run their network server's desktop.

It's not hard to imagine the internet without JS. I remember the early to mid 90s with simple html pages, frames, and animated gifs. And there were gopher sites and pages, radically different from how the web works.

Matthew Hughes is a software developer and writer from Liverpool, England. He is seldom found without a cup of strong black coffee in his hand and absolutely adores his Macbook Pro and his camera. You can read his blog at http://www.matthewhughes.co.uk and follow him on twitter at @matthewhughes.