DEV Community

aclarembeau
aclarembeau

Posted on • Originally published at blog.jotcode.io

Why you should consider JavaScript as a general scripting language?

Although the name may be confusing, JavaScript is not the scripting language of Java. Often considered as a tool to build applications in your web browser, JavaScript is a versatile language offering many possibilities: frontend, backend, and many others… Often neglected for this aspect, we will make you discover why JavaScript can also be considered as a language of choice to design your maintenance and server administration scripts, making it a general purpose scripting language.

Reason #1: Because you already know this language

Unlike other dedicated scripting languages such as Ruby, or Bash, most developers have at least minimal knowledge of JavaScript. In fact, anyone who has dabbled in web programming has already used this language. If you write your maintenance scripts in JavaScript, you will have no trouble sharing them with your colleagues.

Reason #2: Because it runs everywhere

Moreover, it is a language that works on most platforms: personal computers as well as servers, Windows, Mac as well as Linux. With JavaScript, there is no need to write a different version of your code on your workstation.

Reason #3: It is supported by all text editors and IDEs

Even if your main programming language is not JavaScript, most code editors and IDEs offer syntax highlighting and autocompletion of JavaScript code. Adding JavaScript code to the side of your main code will probably not be a problem for you, either in terms of implementation or management.

Reason #4: It’s an efficient language

Although it has often had a bad reputation because of its lack of optimization in some implementations, today’s JavaScript is fast, with top-level concurrency support. If you need to manipulate large amounts of data or make many network calls in parallel, JavaScript will be able to provide you with an efficient and elegant solution, without wasting time, especially thanks to the use of promises.

Reason #5: It’s a popular language

In addition to being known by a large number of users, it is also a popular language with an active community on the web. Thus, you will have much less trouble looking for help on code written in JavaScript, than in a dedicated scripting language for your server.

Reason #6: It has a large ecosystem

Unlike other languages, such as Bash, JavaScript has a fairly large ecosystem of packages and libraries. If you need to perform a particular calculation or processing, it is very likely that someone has done it before you, and you can find a code library online that you can simply add to your script to get the desired result.

Top comments (0)