Without private members, do we still need the keyword "public" in class 
literals?

For example, instead of
  constructor(geometry, materials) {
    super(geometry, materials);
 
    public identityMatrix = new THREE.Matrix4();
    public bones = [];
    public boneMatrices = [];
    ...
  }
I find the following just as intuitive, without the need for the keyword 
"public":
  constructor(geometry, materials) {
    super(geometry, materials);
 
    this.identityMatrix = new THREE.Matrix4();
    this.bones = [];
    this.boneMatrices = [];
    ...
  }

Similarly intuitive is something that I’ve seen somewhere – passing through 
constructor arguments as members.
  class Point {
    constructor(this.x, this.y) {
    }
  }

I don’t think "public" helps, I think it makes things *less* intuitive.

-- 
Dr. Axel Rauschmayer

[email protected]
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to