3 ms·
I also argued strongly against this proposal. To me the biggest problem with private members, as it was implemented, is that is takes classes from “syntactic su
by jwalton 3y ago
I also argued strongly against this proposal. To me the biggest problem with private members, as it was implemented, is that is takes classes from “syntactic sugar on top of prototype inheritance” to something very different than that. It makes the mental mode of the language a lot more complicated, and without a lot of benefit.
I never understood why TC39 was so intent on this “hard privacy” stance they took, as without it there were much better and more sensible compromises that could have been made. (Especially since JS is an interpreted language - if someone wants to work out what private variables are in your code, they can always just inspect the source.)
- hajile 3y agoEven worse, it came at the expense of other things. Records and tuples for example aren’t controversial. They are primitives and therefore solve a few quirks that come from objects. They should also radically improve performance because users can’t change types or add/remove properties causing less optimized lookups. Instead, all that time went into a controversial feature that has made things worse without solving any real issues either.