JavaScript is one of those things many take for granted.

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.

JavaScript became that language.

Developed in ten days by Brendan Eich, the man who (albeit very briefly) would go on to lead Mozilla, it allowed developers to write code in a variety of styles (functional, imperative and object-oriented) in a language which closely resembled other popular languages of the day, such as Java, C++ and C.

javascript-js

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.

Web

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.

If you're curious to read more about jQuery, check out this detailed explanation by James Bruce. If you'd like to try it in the real world, we have a free six-part jQuery course.

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.

Node.js can also be used with Internet of Things projects with Tessel; an Arduino-like board which runs on JavaScript.

For more information on Node.js, check out this more detailed explanation by James Bruce.

Mobile App Development

Mobile apps are big money.

Don't take my word for it! Just look at Nick D'Aloisio, whose Summly app was bought by Yahoo for $30 million when he was at the tender age of 17. Or even Rovio, whose Angry Birds game spawned a multi-million dollar franchise, which boasts toys, films, and even a few theme park attractions.

If you've got a burning idea for a mobile app, be assured you can build it with JavaScript.

Android, iOS, Blackberry and Windows Phone all support building native applications with JavaScript, which can be distributed on their official app stores in the same way as anything built with Java for Android, or Swift for iOS.

Mobile apps written in JavaScript are generally easier to develop, and can often beat native apps in performance metrics.

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.

There are a number of languages which compile down to JavaScript, although the most notable one is CoffeeScript, which we've written about in the past.

javascript-coffeescript.png

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.

For these reasons, CoffeeScript has enjoyed a surge of popularity in recent years, with it being used by both Dropbox and social-coding platform Github.

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.

Frankly, It's hard to imagine the Internet without it.

Photo Credit: I Love jQuery (Christian Ditaputratama)