5 ms·
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 seve
by the_other 5y ago
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.
- unwind 5y agoAs far as I know it's the standard way in Python.
- andy_ppp 5y agoWhy can’t they just introduce a new private keyword, i.e. private let myVar = 0;
- ezekg 5y agoThe proposal doesn’t even know.
- Madeindjs 5y ago> `_` 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/FAQ.md https://github.com/tc39/proposal-private-fields/blob/master/...