<p>We all know that premature optimization is the root of all evil because it leads to unreadable/unmaintainable code.  Even worse is pessimization, when someone implements an "optimization" because they <em>think</em> it will be faster, but it ends up being slower, as well as being buggy, unmaintainable, etc.  What is the most ridiculous example of this that you've seen?</p>

Nothing Earth-shattering, I admit, but I've caught people using StringBuffer to concatenate Strings outside of a loop in Java.  It was something simple like turning
```
```
String msg = "Count = " + count + " of " + total + ".";
```
```
into
```
```
StringBuffer sb = new StringBuffer("Count = ");
sb.append(count);
sb.append(" of ");
sb.append(total);
sb.append(".");
String msg = sb.toString();
```
```
It used to be quite common practice to use the technique in a loop, because it was measurably faster.  The thing is, StringBuffer is synchronized, so there's actually extra overhead if you're only concatenating a few Strings.  (Not to mention that the difference is absolutely trivial on this scale.)  Two other points about this practice:
StringBuilder is unsynchronized, so should be preferred over StringBuffer in cases where your code can't be called from multiple threads.
Modern Java compilers will turn readable String concatenation into optimized bytecode for you when it's appropriate anyway.