3 ms·
The discussion seems to be mostly driven by people who are used to a very specific syntax and can't understand why it wouldn't work for a real implementation fo
by jkrems 8y ago
The discussion seems to be mostly driven by people who are used to a very specific syntax and can't understand why it wouldn't work for a real implementation for private. Nothing will stop these people from keeping their use of "private as documentation only" while others will get their proper implementation of private state that isn't as fragile as the one offered by TypeScript. That last part isn't a dig at TypeScript - it's just that at the time it was the best TS could possibly offer.
I expect that TypeScript will adopt this proposal given that some of the people working on and defending the proposal seem to be part of the TypeScript team.
> Refactoring and index-access notation become awkward with it.
Given that other languages have similar solutions and this actually has more information in the source file, I assume that refactoring will become quicker and index-access will just move to private maps. Adding arbitrary fields at runtime and dynamic access to private fields are both tools with limited value compared to the potential for introducing subtle bugs.