This website uses Cookies and LocalStorage

Where JavaScript is Used?

Post cover

From an almost-dead to a thriving, omnipresent language, JavaScript has come a long way. Thanks to the growth of the World Wide Web (WWW) and a lot of new features being added, JS is currently one of the most popular and in-demand programming languages out there.

With that said, its success wouldn't be possible without expansion into new territories. As many web developers probably know, JS is no longer bound by the browser window.

However, for beginner programmers, it might not be so obvious. And so, I'd like for this article, to be a little, beginner-friendly showcase of JS use-cases and possibilities.

Server-side

Currently, the most developed area of JavaScript outside the browser is surely the server-side. And it's all thanks to Node.js - a JavaScript runtime, which uses the same, super-fast V8 engine like any Chromium-based browser out there (e.g. Chrome, latest Edge and Opera). Not only it allowed JS to be used for simple server tasks like database access and website hosting, but also far more complex ones, which is why it's currently utilized by big companies like Netflix, Uber or PayPal.

Node.js also played a crucial role in the creation and rapid expansion of Node Package Manager (NPM). Its repository currently houses over 1M of both Node.js and browser-compatible open-source JS tools and libraries - all serving the good of the JS community.

Desktop apps

While Node.js is primarily used on pure server-side, its capabilities stretch far beyond that. Its success went on to inspire others to make use of JS in different areas of the programming industry. And so, the Electron framework is a tool using both Node.js and Chromium, which lets you create full-blown desktop apps with the website-like toolset, i.e. HTML, JS, and CSS.

Electron apps are quite easy and fun to create. You can pretty much take a usual website and make it into an Electron app. That's all thanks to it being, to put it simply, just a Chromium web browser, with some additional Operating System (OS)-level features.

Furthermore, you might be using an Electron app without even knowing it. That's due to it being used by really popular apps such as Skype, Discord, and Slack.

Mobile apps

Because Electron is for desktop OSs only (Windows, Mac OS, Linux), mobile apps require their own category.

Hybrid mobile apps

There are multiple ways of making a mobile app in JS. The first one involves the so-called hybrid mobile apps. These, in simple terms, are just usual "native" apps with a WebView (a limited browser-like embed) inside them, running the provided HTML, CSS and JS code. So, essentially, it's very similar to the Electron on the desktop, although here, the framework's name is Apache Cordova. However, hybrid mobile apps, although easy to create, have no performance benefits over a usual website. Thus, on a mobile device, where computing resources are limited, such apps can often underperform. That's probably why they're currently being cast aside in favor of a new technology called PWA.

PWA

Progressive Web Apps (or PWAs for short) are nothing more than usual websites, with some performance and offline-mode enhancements included. If the user's browser provides such functionality, they can be pinned to the main screen and be opened without the search bar, giving them a feeling of usual native apps. And as the same technology works also on desktop, developers can simply create compatible web apps and enjoy all the benefits of PWA without much additional work.

But, if you want your app to have even more "native feel" through increased performance, and availability on the local app store (PWAs are only starting to be allowed there), then there is one more option.

Real nativity

Frameworks like React Native and NativeScript aim to allow developers to write mobile apps with web technologies, but with the feel and performance of native apps. They achieve that by converting your code into a more platform-optimized version while retaining the ease-of-use of JS and related technologies. This approach to creating mobile apps is much more widely-used, with some really prominent apps like Facebook, Messenger, Instagram, Pinterest, Skype, Tesla and many more using the technology.

Embedded devices

It might seem like JS, as an interpreted programming language, is not suitable for small, resource-conscious embedded devices. Surprisingly enough, it made it even there!

Projects like Johnny-Five and others use the power of V8 engine and Node.js to bring JavaScript into the fields of robotics and the Internet of Things (IoT), so essentially everywhere! You can even use it on devices such as Arduino, Rasberry Pi or Intel Edison.

Other applications

So, we've pretty much covered most of the programming areas already, but JS stretches even further. No, we cannot make a whole OS using this language, but if we look closer, we can see start noticing smaller use-cases appearing.

Take Adobe Creative Cloud software for example. Even though e.g. Photoshop isn't written entirely in JS, you can still use this language to write expressions and plugins that can accelerate your productivity and comfort of use of the tool!

Final thoughts

In the end, it seems like JS is pretty much everywhere. Surely it's not true, but the sheer number of areas that it has expanded into is very impressive. And with this expanding ecosystem of tools, libraries, and frameworks, and ever-growing community, it seems like JS isn't going anywhere anytime soon!

If you like the post consider sharing it and following me on Twitter, Facebook, or through my weekly newsletter. If you're interested, I also recommend checking out my YouTube channel. Again, thanks for reading this piece and have a nice day!

Author

Read more

Post cover

Top 5 React state management libraries in late 2020

Managing state in big React apps can be quite troublesome. Here are 5 libraries that can help you with it…

Read More
Post cover

Separation of concerns with custom React hooks

React hooks are pretty cool. So is the separation of concerns. How about bringing them together…

Read More
Post cover

Solid - The best JavaScript UI library?

When it seems like JS UI library landscape couldn't get much crowded, something truly innovative comes out - meet Solid…

Read More

Comments