News for hackers. Stuff that matters.
Re:Implementing Private Fields for JavaScript by the_other on Sunday June 13, 2021 @03:46AM (#27490651)
For some time, there was a trend of adding _ to property and method names to indicate “I’m pretending to be private, don’t use me” (I think this happens in several languages, but I only know JS well).

I suspect there’s a risk that if the committee standardised on _ rather than #, it would actually break a load of older apps and content. There’s a good chance the _convention was abused in those earlier codebases.

Re:Implementing Private Fields for JavaScript by Madeindjs on Sunday June 13, 2021 @05:08PM (#27496512)
> `_` would cause compatibility issues with existing JavaScript code, which has allowed `_` at the start of an identifier or (public) property name for a long time. -- https://github.com/tc39/proposal-private-fields/blob/master/...
Re:Implementing Private Fields for JavaScript by andy_ppp on Sunday June 13, 2021 @06:19AM (#27491342)
Why can’t they just introduce a new private keyword, i.e. private let myVar = 0;
Re:Implementing Private Fields for JavaScript by ezekg on Sunday June 13, 2021 @11:33PM (#27499000)
The proposal doesn’t even know.
Re:Implementing Private Fields for JavaScript by unwind on Sunday June 13, 2021 @05:48AM (#27491211)
As far as I know it's the standard way in Python.