title: Should I use public or private variables?
body: <p>I am doing a large project for the first time. I have lots of classes and some of them have public variables, some have private variables with setter and getter methods and same have both types.</p>
  
  <p>I decided to rewrite this code to use primarily only one type. But I don't know which I should use (variables which are used only for methods in the same object are always private and are not subject of this question).</p>
  
  <p>I know the theory what public and private means, but what is used in the real world and why? </p>