3 ms·
Private class properties have been highly requested for nearly a decade since classes were first mentioned as a part of ES6, since almost after ES5 was formally
by austincheney 5y ago
Private class properties have been highly requested for nearly a decade since classes were first mentioned as a part of ES6, since almost after ES5 was formally published.
This is wanted to make the language more friendly to CS graduates and Java developers who are otherwise not comfortable using the language without the OOP they cannot live without outside this language. As an example, when I have had discussions about this in the past most proponents had no idea how scope works in the language.
- kkirsche 5y agoI appreciate the context here, though I strongly dislike the reason. One of the values, in my opinion, of learning and working with multiple languages is being exposed to new paradigms and concepts rather than relying on a single approach to solving problems. At its core, javascript is a procedural language, with many functional concepts, and the more we try to hide the prototype-based underpinnings, I think it hurts this growth opportunity. With that said, JS is a mess in a lot of ways, so maybe this is worthwhile. Hard to know though until it’s too late to revert. Just my opinion though, I’m curious what others think about this and where I may be missing the mark.
- zanethomas 5y ago1. Javascript never needed classes. Classes in javascript do not always behave as "cs graduates and java developers" expect, so bugs. 2. Java (and c++) are great examples of class-oriented languages. Javascript is object-oriented.
- austincheney 5y agoYes, if I wanted to write Java then I wouldn’t be writing JavaScript. Not ever. However, I do enjoy JavaScript and part of that enjoyment comes from not writing classes.