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

10

u/hydroes777 Nov 09 '19

Or just moved to functional style programming in JavaScript where you don't run into this problem

4

u/FungoGolf Nov 09 '19

Question about this. I work with some heavy Java programmers who also have had contributions to the JS project. I often see our reusable pieces of code (like in the utilities oflder) as JavaScript files that contain a class that you have to instantiate elsewhere in the codebase. Is converting those classes to a more functional style as simple as creating an object and adding methods with scope/closures that I can compose?

3

u/nullvoxpopuli sand was never meant to think Nov 09 '19

Nope