title: StringBuilder/StringBuffer vs. "+" Operator
body: <p>I'm reading "<em>Better, Faster, Lighter Java</em>" (by Bruce Tate and Justin Gehtland) and am familiar with the readability requirements in agile type teams, such as what Robert Martin discusses in his clean coding books.  On the team I'm on now, I've been told explicitly not to use the <code>+</code> operator because it creates extra (and unnecessary) string objects during runtime.  </p>
  
  <p>But this <a href="http://www.ibm.com/developerworks/java/library/j-jtp01274.html" rel="noreferrer">article</a>, Written back in '04 talks about how object allocation is about 10 machine instructions. (essentially free)</p>
  
  <p>It also talks about how the GC also helps to reduce costs in this environment.  </p>
  
  <p>What is the actual performance tradeoffs between using <code>+</code>, <code>StringBuilder</code> or <code>StringBuffer</code>?  (In my case it is <code>StringBuffer</code> only as we are limited to Java 1.4.2.)  </p>
  
  <p><code>StringBuffer</code> to me results in ugly, less readable code, as a couple of examples in Tate's book demonstrates.  And <code>StringBuffer</code> is thread-synchronized which seems to have its own costs that outweigh the "danger" in using the <code>+</code> operator.  </p>
  
  <p>Thoughts/Opinions?</p>