On 2008-11-22, at 23:54EST, Peter Michaux wrote:


       let privClassVar = 1;
       const privClassConst = -1;

So members are private by default? I like that and it is consistent
with a style of JavaScript OOP popular today. In the wiki page members
are public by default which is as dangerous as implied globals (i.e. a
missing "var") in ES3.

My 2p: I feel just the opposite. Conflating classes (OOP) with access control is a big mistake in my book, a big mistake made by Java that we ought to learn from. It leads you to either write really huge classes, or to have to 'decorate' all your classes with public declarations. Access control should have its own orthogonal mechanism -- modules or packages that can consist of one or more classes and can gather the access control declarations in one spot so they are easily analyzed, as opposed to scattering them over all the component classes.
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to