@wallhackio Please educate me about the differences between ES5 and ES6
@vaporeon_ are you familiar with the term ecmascript?
@wallhackio That's the proper name for what's commonly called JavaScript, right? I once saw a print-out of the ECMAscript standard, but I didn't pick it up, unfortunately
@vaporeon_ sun microsystems trademarked JavaScript in the 90s because of course they did, so when JavaScript was standardized (I believed in 1997?) the committee was not sure if they had the rights to publish a document with that term.
they were going to call it LiveScript (or was it ActionScript? i forgot which) but Netscape had also trademarked that name and as such the committee wasn't sure if they could use that name either.
the group which standardized JavaScript was, at the time, part of the European Computer Manufacturer's Association, or ECMA for short, and since they ran out of time before both Sun and Netscape could get back to them regarding the preferred names, the committee decided to settle with the name ECMAScript. Nobody liked the name but it was chosen and now it stuck.
@vaporeon_ regarding ES5 and ES6:
The language had a small spec update in 1998 (ES2) and then a more significant update in 1999 (ES3). ES3 is when the language really caught on.
ES4 was then developed for many years but due to political differences, poor management, and concerns of growing complexity in the proposals, it was tossed and the committee started over. They were not able to come to a consensus on a new update to the language until 2009, at which point they decided to call the spec ES5 instead of ES4 for some reason.
ES6 was then developed in 2015 and was the most impactful update the language specification. It introduced an entire new syntax for declaring functions, new syntax for declaring variables, promises (a built-in abstraction for concurrency/asynchronous programming), template strings, generator functions, weak references, and so much more. It completely changed the language. (Mostly) for the better.
@wallhackio @vaporeon_ ES6 was not more impactful than ES5 in terms of the fundamental behaviours of the language, as ES5 added strict mode, getters and setters, low‐level things like Object.getPrototype, Object.setPrototype, and Object.defineProperty, and so forth. Most ES6 code can be transpiled into equivalent ES5 code, whereas ES5 introduced fundamental concepts around writability, enumerability, an access which could not be ported back to ES3. However, most programmers do not take advantage of the unique qualities of JavaScript introduced by ES5 and ES6 introduced more syntactic sugar for common operations. In addition, when ES6 came out, people created transpilers back to ES5 so the ES6/ES5 distinction was more firmly established in people’s minds.
@wallhackio @vaporeon_ newer developments to the language, for example static blocks and private members in class declarations, are innovative and can’t be simply ported back to ES5 with the same semantics. but these weren’t a part of class declarations when they were originally introduced; people just lump them in the category of “ES6” because they associate them with post‐ES5 javascript. ES6 itself offered very little; even async/await (which are fundamental to modern JS) weren’t added until ES8.
@vaporeon_ @wallhackio they actually stopped using numbers but they’re on 15 (a·k·a EcmaScript 2024) right now; they release a new one each year