5 ms·
I think you're mixing up your timelines. ES5 brought `Object.create` and other prototype helper methods. This was a heyday, of sorts, for JS as a prototypal lan
by ChrisSD 7y ago
I think you're mixing up your timelines. ES5 brought `Object.create` and other prototype helper methods. This was a heyday, of sorts, for JS as a prototypal language with Crockford and others trying to explain how prototypes differ from inheritance based classes. However even then the C++/Java model had become too well ingrained by that point, especially at certain very large tech companies.
The `class` keyword was introduced in ES6, which is indeed a kludge on top of prototypes.
- masklinn 7y ago> I think you're mixing up your timelines. ES5 brought `Object.create` and other prototype helper methods. You’re right, I did. So the actual timeline was somewhat less dim than I remembered. > The `class` keyword was introduced in ES6, which is indeed a kludge on top of prototypes. I wouldn’t say that it’s a kludge. I’d anything it’s more of a realisation of the original vision of JavaScript (which you could fairly call a kludge): using a prototype system to underlie a langage approaching java semantics. Which may well be the dumbest way to approach it as you get the flexibility of a class-based system and the performances of a prototype-based system rather than the other way around, but at the same time JS’s prototype system was kneecapped from the start.