title: What is the preferred way of getting value in swift, var vs. func?
body: <p>What's the preferred way of getting a value in swift?
  Using a read-only variable</p>
  
  <pre><code>var getString: String? {
      return "Value"
  }
  </code></pre>
  
  <p>or using a function?</p>
  
  <pre><code>func getString() -&gt; String? {
      return "Value"
  }
  </code></pre>
  
  <p>Also, is there a performance difference between the two?</p>