title: reference or return - best practice
body: <p>For example we have encoding function. What is the best practice to use:</p>
  
  <pre><code>void Crypto::encoding(string &amp;input, string &amp;output)
  {
      //encoding string
      output = encoded_string;
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>string Crypto::encoding(string &amp;input)
  {
      //encoding string
      return encoded_string;
  }
  </code></pre>
  
  <p>Should we use reference or return for returning the string? As far as I know returning a string will take some time to initialize a new string that will be returned by return instruction. When working on a referenced variable I don`t waste time to initialize some new variable I just end the function.</p>
  
  <p>Should we mostly use reference and make function return type void? Or we should only return data by reference when we want to return two or more variables and when we need return one variable then use return instruction?</p>