In this chapter, we examine the pros and cons of JavaScript.
“ECMAScript 6” and “ES6” refer to versions of JavaScript
ECMAScript is the name of the language standard; the number refers to the version of that standard. For more information, consult “Standardization: JavaScript vs. ECMAScript” (§5.2).
Among programmers, JavaScript isn’t always well liked. One reason is that it has a fair amount of quirks. Some of them are just unusual ways of doing something. Others are considered bugs. Either way, learning why JavaScript does something the way it does, helps with dealing with the quirks and with accepting JavaScript (maybe even liking it). Hopefully, this book can be of assistance here.
Additionally, many traditional quirks have been eliminated now. For example:
let
and const
, which let you declare block-scoped variables.
function
and .prototype
was clumsy. ES6 introduced classes, which provide more convenient syntax for these mechanisms.
Lastly, JavaScript’s standard library is limited, but:
On the plus side, JavaScript offers many benefits.
JavaScript’s popularity means that it’s well supported and well documented. Whenever you create something in JavaScript, you can rely on many people being (potentially) interested. And there is a large pool of JavaScript programmers from which you can hire, if you need to.
No single party controls JavaScript – it is evolved by TC39, a committee comprising many organizations. The language is evolved via an open process that encourages feedback from the public.
With JavaScript, you can write apps for many client platforms. These are a few example technologies:
JavaScript is supported by many server platforms and services – for example:
There are many data technologies available for JavaScript: many databases support it and intermediate layers (such as GraphQL) exist. Additionally, the standard data format JSON (JavaScript Object Notation) is based on JavaScript and supported by its standard library.
Lastly, many, if not most, tools for JavaScript are written in JavaScript. That includes IDEs, build tools, and more. As a consequence, you install them the same way you install your libraries and you can customize them in JavaScript.
There is much innovation in the JavaScript ecosystem: new approaches to implementing user interfaces, new ways of optimizing the delivery of software, and more. The upside is that you will constantly learn new things. The downside is that the constant change can be exhausting at times. Thankfully, things have somewhat slowed down, recently: all of ES6 (which was a considerable modernization of the language) is becoming established, as are certain tools and workflows.