title: Why not to use closures for object attributes?
body: <p>I'm currently writing objects in javascript and I would like to do it in a clear, nice way, using best practices etc. But I'm bothered that I must always write <code>this.</code> to address attributes, unlike in other OO languages. </p>
  
  <p>So I got the idea -  <strong>why not just use closures for object attributes?</strong> Look at my example object. So instead of this, classical way:</p>
  
  <pre><code>var MyObjConstructor = function (a, b) {
  
      // constructor - initialization of object attributes
      this.a = a;
      this.b = b;
      this.var1 = 0;
      this.var2 = "hello";
      this.var3 = [1, 2, 3];
  
      // methods
      this.method1 = function () {
          return this.var3[this.var1] + this.var2; 
              // terrible - I must always write "this." ...
      };
  
  }
  </code></pre>
  
  <p>... I would do it <strong>using closure</strong> and then I don't need to write <code>this.</code> every time to access the attributes!</p>
  
  <pre><code>var MyObjConstructor = function (a, b) {
  
      // constructor - initialization of object attributes
      // the attributes are in the closure!!!
      var a = a;
      var b = b;
      var var1 = 0;
      var var2 = "hello";
      var var3 = [1, 2, 3];
  
      // methods
      this.method1 = function () {
          return var3[var1] + var2;
              // nice and short
      };
  
      // I can also have "get" and "set" methods:
      this.getVar1 = function () { return var1; }
      this.setVar1 = function (value) { var1 = value; }
  }
  </code></pre>
  
  <p>Also, it has a hidden benefit that the attributes really cannot be accessed any other way than by get/set methods!!</p>
  
  <h3>So the question is:</h3>
  
  <ol>
  <li>Is this a good idea? Is it "clean", is it conforming to best practice?</li>
  <li>Are there any other semantical differences between these 2 solutions?</li>
  <li>Are there any traps with using closure like this?</li>
  </ol>