Where JavaScript is Used?

栏目: IT技术 · 发布时间: 6年前

内容简介:From an almost-dead to a thriving,With that said, its success wouldn't be possible without expansion intoHowever, 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

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!


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

CSS精粹

CSS精粹

Rachel Andrew / 曹明伦 / 人民邮电出版社 / 2007-10 / 39.00元

本书采用问答的形式,为CSS使用过程中一些有价值的经典问题提供了精彩的实践解决方案。本书内容包括文本样式、CSS图像、导航、表格数据、注册表和用户界面、浏览器和设置支持、CSS定位和布局以及未来相关技术。 本书的目标读者是每一个需要使作CSS的Web设计人员和开发人员。本书通过经典的问题和精彩的解答将理论融于实践,使每一个带着问题阅读本书的读者都能找到自己满意的答案。一起来看看 《CSS精粹》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

html转js在线工具
html转js在线工具

html转js在线工具