JavaScript in the Cloud
Tags: javascript, cloud, node, azure
Published: 2021-03-22 04:09:29

_A look at the history of JavaScript and the fun stuff you can do with **JavaScript** in the **cloud!**_ 

## Introduction

Traditionally, [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) is the language of the web, and it still is. But today, it's so much more. With the advent of server-side JavaScript and JavaScript support in major cloud platforms, JavaScript's power increased dramatically. Building, maintaining, optimising, and deploying end-to-end JavaScript applications is possible with JavaScript in the cloud.

Cloud platforms give us the tools, elasticity and scalability to create high performing applications without managing the physical infrastructure. You can take advantage of the cloud while using a language you already know: **JavaScript!**

## What is the Cloud?

The [cloud](https://azure.microsoft.com/en-au/overview/what-is-the-cloud/) refers to software and services that run on the Internet instead of locally on your computer. The cloud is a server somewhere else, usually in a big data centre. Cloud providers such as [Azure](https://azure.microsoft.com/), [AWS](https://aws.amazon.com/), [Google Cloud](https://cloud.google.com/) allow you to rent space on a server and pay for what you use. They let you scale as your business needs change while they manage the physical infrastructure for you. Think of it as renting a house or renting a piece of land, providing different control levels over managing the property, depending on which type of cloud computing you are using.

So really, there is no cloud. It's just someone else's computer.

![There is no cloud, it's just someone else's computer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5k4g60athpn87g7q4uj9.png)

## What is JavaScript?

JavaScript is a language that allows you to implement complex features on web pages.

It was created in [1995 in just ten days](http://speakingjs.com/es5/ch04.html) by [Brendan Eich](https://brendaneich.com/), who worked for [Netscape](https://isp.netscape.com/). He created JavaScript as a scripting tool to manipulate web pages in the Netscape Navigator browser.

JavaScript took off to become the most popular client-side programming language. Today [97% of the web uses JavaScript](https://w3techs.com/technologies/details/cp-javascript)!

However, JavaScript is much more than just a client-side programming language. [Scott Hanselman](https://www.hanselman.com/), a Partner Program Manager at Microsoft, even went so far as to say that he proposes [JavaScript is an operating system](https://youtu.be/msPocYnU0N4?t=2532). He based the comparison on the fact that JavaScript has the same characteristics as an operating system.

JavaScript is a flexible and robust language. Thus, it makes sense for us to use JavaScript in the cloud.

## JavaScript in the Cloud

Initially, Eich wrote JavaScript as both a client and server-side language. However, it didn't become popular as a server-side language until later on with the [creation of Node.js in 2009](https://nodejs.dev/learn/a-brief-history-of-nodejs).

[Node.js](https://nodejs.dev/) is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser. With the advent of Node.js as a server-side JavaScript programming language, it opened up the ability to use JavaScript in the cloud.

Today, all the major cloud providers support JavaScript in the cloud.

And, in the words of [Scott Hanselman](https://www.hanselman.com/):

> The cloud doesn't care about language choice.

## Tools for JavaScript in the Cloud

If you are looking to develop JavaScript in the cloud, there are some excellent tools and guides out there to help you. JavaScript IDEs such as [Visual Studio Code](https://code.visualstudio.com/) and [WebStorm](https://www.jetbrains.com/webstorm/) have extensions that let you integrate with your favourite cloud providers, access quickstart templates, write, debug and deploy your cloud applications.

![Creating an Azure Function in VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p1pohbahyq1f7q2tblgv.gif)

All major providers have a suite of SDKs and client libraries in JavaScript to integrate with their services from your JavaScript application. These libraries allow you to:

- Recognise and transcribe human speech with [speech to text](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-speech-to-text?tabs=windowsinstall&pivots=programming-language-browserjs)
- Integrate into an [Azure Digital Twins](https://docs.microsoft.com/en-us/azure/digital-twins/overview) solution
- Add a rich [Cognitive Search](https://docs.microsoft.com/en-au/azure/search/search-what-is-azure-search) to your web app

And much more!

## Power of JavaScript

JavaScript is a powerful language. We can use JavaScript for web, mobile, gaming, artificial intelligence, and so much more.

Watch Scott Hanselman's talk [JavaScript, The Cloud, and The Rise of the New Virtual Machine](https://youtu.be/msPocYnU0N4) to see a demo of a complete implementation of Linux and Pentium processor implemented in JavaScript and some other crazy things you can do in JavaScript.

There is a concept called the [Rule of Least Power](https://www.w3.org/2001/tag/doc/leastPower.html) from [Tim Berners-Lee](https://www.w3.org/People/Berners-Lee/), the creator of the web. The rule suggests choosing the least powerful language suitable for a given purpose.

As a [corollary](https://www.merriam-webster.com/dictionary/corollary) to this rule, we get [Atwood's Law](https://blog.codinghorror.com/the-principle-of-least-power/).

> Any application that _can_ be written in JavaScript, _will_ eventually be written in JavaScript.

## Summary

In conclusion, I hope if you are not yet using JavaScript, you go out and learn it today. If you already are using JavaScript, I hope you start exploring what you can do with it.

Because the opportunities with JavaScript are endless, especially when paired with the power of the cloud.