title: private[this] vs private
body: <p>In Scala I see such feature as object-private variable. From my not very rich Java background I learnt to close everything (make it private) and open (provide accessors) if necessary. Scala introduces even more strict access modifier. Should I always use it by default? Or should I use it only in some specific cases where I need to explicitly restrict changing field value even for objects of the same class? In other words how should I choose between</p>
  
  <pre><code>class Dummy {
      private var name = "default name"
  }
  
  class Dummy {
      private[this] var name = "default name"
  }
  </code></pre>
  
  <p>The second is more strict and I like it but should I always use it or only if I have a strong reason?</p>
  
  <p>EDITED: As I see <a href="http://www.tutorialspoint.com/scala/scala_access_modifiers.htm" rel="noreferrer">here</a> <code>private[this]</code> is just some subcase and instead of <code>this</code> I can use other modifiers: "package, class or singleton object". So I'll leave it for some special case.</p>