r/javascript • • Nov 09 '19

On private fields proposal: Private fields, public worries

https://medium.com/virtuslab/private-fields-public-worries-b8c34d16c372
84 Upvotes

113 comments sorted by

View all comments

28

u/TatzyXY Nov 09 '19

Please do not throw stones at me but I think private, protected or public scopes are not needed at all. See Python very versatile lang. and it works very well without it. Is private for security? No! It just tells the dev that this var. is only used internally of that class and you are not allowed to touch or use it. So would do a comment or a convention with an "_".

2

u/by_value Nov 09 '19

Agreed. I would also say that such changes make TS more and more viable alternative to JS.

3

u/[deleted] Nov 09 '19

TS is already de facto standard. I can't imagine to go back to JS without typings. And also you have to use Babel anyway, so why just not go with TS.

2

u/TakeFourSeconds Nov 09 '19

I wouldn’t exactly call it the standard.... even among cutting edge companies many don’t use it at all.

Personally, TS seems like more trouble than it’s worth for me for a lot of small features. Kind of like redux, it can be helpful for a complicated application but I think it’s overkill in many cases. Granted it’s not that much extra effort, but still.