title: Why cant i just use public property and not be looked down at
body: <p>I see (and write) a lot of code like this:</p>
  
  <pre><code>class MyClass
  {
      private $_myProperty;
  
      public function setMyPropert($myProperty)
      {
           $this-&gt;_myProperty = $myProperty;
      }
  
      public function getMyProperty()
      {
           return $this-&gt;_myProperty;
      }
  }
  </code></pre>
  
  <p>Since we are taught that class properties should always be private.</p>
  
  <p>However, i really just want to do this in the above scenario:</p>
  
  <pre><code>class MyClass
  {
      public $myProperty;
  }
  </code></pre>
  
  <p>Thats much less code and easier to read.  But other developers would look down on this code and most likely it would fail code reviews etc.  Even if not, i would still never do this for fear of someone else seeing it and making judgement.</p>
  
  <p>Why though?  Is this something that is just ingrained in developers of oop code?  Or is there another reason that I'm missing, perhaps related to testing, future maintenance or other non obvious technical reason.  I am talking specifically in a scenario where the getter/setter does noting more that get/set.</p>