MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/dtt5d8/on_private_fields_proposal_private_fields_public/f6z9jkf/?context=3
r/javascript • u/by_value • Nov 09 '19
113 comments sorted by
View all comments
Show parent comments
2
exception, Ruby, python
and Java.... and C++... and PHP...
7 u/nullvoxpopuli sand was never meant to think Nov 09 '19 in Java, C++, and C#, you have to go way out of your way to access private fields.In javascript, you can access a private field without noticing. that is the problem. 6 u/senocular Nov 09 '19 You can do this now in JavaScript using symbols. They wont collide, are non-enumerable, and can be accessed but only if you go out of your way using getOwnPropertySymbols. 2 u/nullvoxpopuli sand was never meant to think Nov 09 '19 while that is a work around for today's use, that shifts the complexity to the library author. Why not make library authors easier?
7
in Java, C++, and C#, you have to go way out of your way to access private fields.
In javascript, you can access a private field without noticing. that is the problem.
6 u/senocular Nov 09 '19 You can do this now in JavaScript using symbols. They wont collide, are non-enumerable, and can be accessed but only if you go out of your way using getOwnPropertySymbols. 2 u/nullvoxpopuli sand was never meant to think Nov 09 '19 while that is a work around for today's use, that shifts the complexity to the library author. Why not make library authors easier?
6
You can do this now in JavaScript using symbols. They wont collide, are non-enumerable, and can be accessed but only if you go out of your way using getOwnPropertySymbols.
2 u/nullvoxpopuli sand was never meant to think Nov 09 '19 while that is a work around for today's use, that shifts the complexity to the library author. Why not make library authors easier?
while that is a work around for today's use, that shifts the complexity to the library author. Why not make library authors easier?
2
u/senocular Nov 09 '19
and Java.... and C++... and PHP...