<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: StringBuffer considered harmuful</title>
	<atom:link href="http://en.newinstance.it/2005/06/07/stringbuffer-considered-harmuful/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.newinstance.it/2005/06/07/stringbuffer-considered-harmuful/</link>
	<description>Welcome to the official blog of Luigi R. Viggiano. Beware of imitations.</description>
	<lastBuildDate>Fri, 13 Jan 2012 02:25:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: CC</title>
		<link>http://en.newinstance.it/2005/06/07/stringbuffer-considered-harmuful/comment-page-1/#comment-173963</link>
		<dc:creator>CC</dc:creator>
		<pubDate>Fri, 25 Apr 2008 13:22:09 +0000</pubDate>
		<guid isPermaLink="false">http://it.newinstance.it/2005/06/07/stringbuffer-considered-harmuful/#comment-173963</guid>
		<description>Hi,

I understand what you are trying to say. BUT i can&#039;t agree on some points and a liite bit confused of how/ why are you demonstrating such stuff ... so prob., the questions I would ask here:

Why are you creating a new StringBuffer each time?
Without running this test, I can assume taht will be slow down the process, if you re-locate thet one in front of loop OR insert a real new String() on each place where you work with strings, that might be closer to a real compare.

Even if they are internal compiler, whci is right an very important, we might provide at least similar stuff; for instance:

String expression = new String();
expression  = &quot;bla&quot;;
expression  = &quot;bla ba&quot;;

OR choose the same logic on StringBuffe side:

String expression = new StringBuffer( &quot;bla&quot;.length*3 );
expression.append(&quot;bla&quot;).append(bla&quot;).append(bla&quot;);


Well ... however, I won&#039;t use Strings anyway if I can avoid it ;) 
If you think that&#039;s better, of course that will be fine.

Cheers!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I understand what you are trying to say. BUT i can&#8217;t agree on some points and a liite bit confused of how/ why are you demonstrating such stuff &#8230; so prob., the questions I would ask here:</p>
<p>Why are you creating a new StringBuffer each time?<br />
Without running this test, I can assume taht will be slow down the process, if you re-locate thet one in front of loop OR insert a real new String() on each place where you work with strings, that might be closer to a real compare.</p>
<p>Even if they are internal compiler, whci is right an very important, we might provide at least similar stuff; for instance:</p>
<p>String expression = new String();<br />
expression  = &#8220;bla&#8221;;<br />
expression  = &#8220;bla ba&#8221;;</p>
<p>OR choose the same logic on StringBuffe side:</p>
<p>String expression = new StringBuffer( &#8220;bla&#8221;.length*3 );<br />
expression.append(&#8220;bla&#8221;).append(bla&#8221;).append(bla&#8221;);</p>
<p>Well &#8230; however, I won&#8217;t use Strings anyway if I can avoid it ;)<br />
If you think that&#8217;s better, of course that will be fine.</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

