Blog post cover
Arek Nawo
10 Jun 2019
8 min read

JavaScript is dead - long live... ECMAScript!?

I’d like to begin this article by explaining the title. I bet you’ve already seen something similar one before. But man - this is so suitable for today’s topic - especially in its customized form!

So, what lead me to write this post is not many, but quite a few discussion threads around the web that I’ve seen, with snippets like this:

const sayHello = toBeSaid => {
    console.log(toBeSaid);
}
sayHello("Hello World!");

And comments like - “It’s not JavaScript!”, pointing out to ECMAScript nature of the given code. Yeah, such comments really make me rethink my own understanding of the matter. But, I decided to use some of my free time to finally explain rather clearly, why such perception is bad (hopefully not in my eyes only). So, here we go with some history, fact and a general explanation of JavaScript (JS) - ECMAScript (ES) relationship, in a beginner-friendly way.

What’s JavaScript?

Let’s start with basic basics. According to Wikipedia, JS is a high-level, dynamically-typed interpreted (nowadays partially JIT-compiled) programming language. Aside from HTML and CSS, it’s one of the core technologies, forming today’s World Wide Web.

History

But, what I’d like to focus on here, and what isn’t really considered common knowledge, is the history of the language. JS itself dates back to the times when Netscape was leading the WWW revolution. It’s the beginning of the 90s, and, in 1993, the world’s first GUI web browser is released by what would later come to be Netscape Communications. It quickly grew in popularity, creating a need for something, that would work alongside HTML for better programming experience and expressiveness.

That’s why, in 1995, Brendan Eich - the future creator of JS and co-founder of Mozilla - was recruited. His first goal was to port Scheme - another programming language - to work in the Netscape Navigator (the GUI web browser), but it was quickly changed. To compete with Microsoft in the web technologies department, Netscape considered to implement Java instead, and - when this plan backfired as well - to create a new language that would be simple, fresh and somewhat similar to Java. As the decision-making process took quite a lot of time, and the company needed to have a prototype to support the idea, Eich delivered - in just 10 days. That’s also how the argument, commonly used by JavaScript haters, who consider it messy and a badly-written language, came to be.

After the name was decided, and the language released to the public, JS quickly took off. Definitely, a part of the reason for this was the naming controversy, but also its adoption by Microsoft. But, with that said, Microsoft brought quite a few complications to the table. They didn’t want to use the JS itself but rather created their own reverse-engineered implementation, known as JScript. It came with a few additional APIs and differences (DOM models, CSS APIs, HTML extensions, etc.). That’s why it was very hard back then to create a cross-browser web page, leading to often-seen messages like “Best viewed in IE”. In the end, Netscape’s JavaScript came to be considered the mainstream one.

Standarization

In 1996, in order to standardize JS and make it accessible for other browser vendors, Netscape submitted it to ECMA International organization. This resulted in language’s specification being released and called ECMAScript, in the first edition of the ECMA-262 standard, in 1997.

What’s ECMAScript?

To get a broader view of JS, you have to know what ECMAScript is, and thus, know what ECMA International is to begin with. So, it’s a standard-defining organization, created back in 1961. The ECMA was a European-related acronym until 1994, when it was changed to reflect the organization’s global reach. Beginning from then, ECMA is a full-blown name, without any hidden meaning.

ECMA International defines standards as we know them, to make things more general, specific, and standardized across the board. More popular examples of these include ECMA-334 (C#), ECMA-404 (JSON), ECMA-408 (Dart) and, finally, ECMA-262, which defines the ECMAScript specification.

Specification

ECMAScript is defined in ECMA-262, as a scripting-language specification. It first appeared in 1997 and helped in bringing order back to all JS variations that were out there in the wild. Of course, it’s most well-known implementation is JS, as - quite frankly - it was the one that ES was based on. But, as its just a specification, there are a lot more languages implementing it. Examples include earlier-mentioned JScript, and ActionScript, popularized by Adobe. These two languages, even if they follow the same specification, can have a slightly different syntax and some extensions of its own.

Relation

To summarize everything said above - JavaScript is just an implementation of ECMAScript, which was originally based on earlier releases of JavaScript. It’s actually pretty interesting.

I have some thoughts why, at least some people, can have problems understanding this relatively simple idea. I have a feeling that there was a great switch back in 2015, with the release of ES6 (new version of the specification). It just brought so many changes - something that hasn’t been done since the release of the previous version (v5.1) in 2011, and arguably even 2009 (v5). This was just too much - even for the ever-green browsers vendors, like Google Chrome - to handle all at once. That’s how transpilers like Babel come into play, became very popular and created a wall between developers accepting the new things quickly, and the ones staying strong with what they already have.

To somehow differentiate the “old JS”, that a lot of developers still used, from the one based on the newer specification, people began referring to the second one, simply as “ES6”. And, as some might already know the difference between ES and JS, or have read about it somewhere already - there’s nothing particularly wrong for them, regarding this terminology. Only that beginners, without some simple explanation, might fall into a sneaky trap.

Going further on this path, the wrong terminology is not really that bad. The worst case scenario is when people may start to refuse using all the goodness that the newest specification has to offer, not from their own choice or the lack of browser support for it, but the perception that it’s just not the same JS.

Versioning

Since the release of ES6 in 2015, JS has seen immense growth in popularity and use-cases. New versions are appearing every year around June - thus ES2019 is just around the corner or it has already happened, depending on when you’re reading this.

Also, since ES6, as the releases are based on yearly schedule now, so is the naming of newer versions. Instead of using hard to remember numbers, they simply started to use years. Thus, ES6 can also be called ES2015 (as it’s the year the shift was made), and all the versions that came after it are ES2016, ES2017, ES2018, and up.

Having a new specification doesn’t really indicate that it’ll be immediately implemented by browser vendors. Some features will be implemented later, some sooner, and some - not at all. It really depends on the browser, or should I say - JavaScript engine that it’s using. In case of Chromium (Chrome, Opera and more than 70% of the market in general) - it manages to stay pretty up to date with the latest features and specs when considering its V8 JS engine. Oh, and the engines, naturally, also have the versioning of their own, just like browsers they’re included in.

My personal take

For me, personally, differentiating between ES and JS wasn’t such a big deal. I consider myself lucky, because of my choice to start learning JS back in 2015/2016, when the whole “JS hype train” took off. I first learned it in its basic, ES5-based form. I enjoyed it from the start. Learning about its new ES6 features and syntax later was just pure joy. As I learned mostly online and with a lot of books, the lecture of “You Don’t Know JS: ES6 & Beyond” really helped me strengthen my understanding of ES6. Now, with this article, I hope I managed to strengthen yours.

I hope you like the article. If ES vs JS wasn’t a problem for you from the beginning - congratulations! At least I hope that this quick review of JavaScript and ECMAScript history provided you with insides and interesting facts.

As always, feel free to share your thoughts in the comment section below. If you like this post, consider following me on Twitter, on my Facebook page, or through the weekly newsletter. Thank you for reading this one, and have a nice day!

If you need

Custom Web App

I can help you get your next project, from idea to reality.

© 2024 Arek Nawo Ideas