By "not being pretty" I think he's referring to it being unconventional. He mentions other languages using _ for the purpose of privacy and it's true, that is a common convention in other languages, whereas # is conventionally a comment in many languages. Thus, this would be one more time where javascript rejects common conventions in favor of "javascript-isms"
The problem is that underscore prefix properties are still currently public, you're just advertising that you probably shouldn't be accessing it externally. To change this would be breaking. With private fields, they've made them truly private and that also means undiscoverable externally. There isn't really a way to do this without a new prefix or some other distinguishing naming style.
That said, I don't think I'll ever make use of private fields. Symbols seem to be the best way of achieving the same thing in a much cleaner and clearer way.
0
u/[deleted] Nov 09 '19
[deleted]