title: Pointer vs variable in class
body: <p>I know what is the difference and how they both work but this question is more about coding style.</p>
  
  <p>Whenever I'm coding I make many classes, they all have variables and some of them are pointers and some are normal variables. I usually prefer variables to pointers if that members lasts as long as the class does but then my code becomes like this:</p>
  
  <pre><code>engine-&gt;camera.somevar-&gt;x;
  // vs
  engine-&gt;camera-&gt;somevar-&gt;x;
  </code></pre>
  
  <p>I don't like the dot in the middle. Or with private variables:</p>
  
  <pre><code>foo_.getName();
  // vs
  foo_-&gt;gatName();
  </code></pre>
  
  <p>I think that dot "disappears" in a long code. I find <em>-></em> easier to read in some cases.</p>
  
  <p>My question would be if you use pointers even if the variable is going to be created in the constructor and deleted in the destructor? Is there any style advice in this case?</p>
  
  <p>P.S. I do think that dot is looks better in some cases.</p>