<?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 for Bob On Development</title>
	<atom:link href="http://bobondevelopment.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobondevelopment.com</link>
	<description>Musings on the craft and business of software development</description>
	<lastBuildDate>Thu, 26 Aug 2010 03:21:57 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Three Ways to Clear a StringBuilder by Renzo</title>
		<link>http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/comment-page-1/#comment-9561</link>
		<dc:creator>Renzo</dc:creator>
		<pubDate>Thu, 26 Aug 2010 03:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/#comment-9561</guid>
		<description>Hi. 

Doesnt work on netbeans.  Length is not accesible.

This is my info:
Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01
System: Windows XP version 5.2 running on x86; Cp1252; es_VE (nb)
Userdir: C:\Documents and Settings\Renzo\.netbeans\6.8

Any idea why it doesnt work?

&lt;em&gt;Bob responds:
We&#039;re not talking Java here, this applies to the .NET framework.&lt;/em&gt;
</description>
		<content:encoded><![CDATA[<p>Hi. </p>
<p>Doesnt work on netbeans.  Length is not accesible.</p>
<p>This is my info:<br />
Product Version: NetBeans IDE 6.8 (Build 200912041610)<br />
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01<br />
System: Windows XP version 5.2 running on x86; Cp1252; es_VE (nb)<br />
Userdir: C:\Documents and Settings\Renzo\.netbeans\6.8</p>
<p>Any idea why it doesnt work?</p>
<p><em>Bob responds:<br />
We&#8217;re not talking Java here, this applies to the .NET framework.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on To Unicode or Not To Unicode by Tod Birdsall</title>
		<link>http://bobondevelopment.com/2010/04/09/to-unicode-or-not-to-unicode/comment-page-1/#comment-9554</link>
		<dc:creator>Tod Birdsall</dc:creator>
		<pubDate>Thu, 10 Jun 2010 13:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/?p=178#comment-9554</guid>
		<description>Hi Bob, I used to live in Fountain Hills and we met once or twice to talk shop. The org I work for is in the process of converting our existing SQL 2005 data from ASCII to Unicode.  It has been mostly &quot;search and replace&quot;, so far. Not fun, but not too hard, if you are fluent in regular expressions. ;-)
Just a side note: You mention &quot;NText rather than Text&quot;. If you are using SQL 2005/2008, NTEXT has been deprecated; You should now use NVARCHAR(MAX), instead.

&lt;em&gt;Bob responds:

Hi, Tod.  Thanks for the tip, I had not noticed that deprecation (largely because I don&#039;t have any current projects that actually need Unicode).  I did a little research and found this interesting and helpful link that deals with a little &quot;gotcha&quot; when converting legacy ntext to nvarchar(max) and also documents the fact that SQL 2005+ has much worse performance with ntext than previous versions:

http://geekswithblogs.net/johnsPerfBlog/archive/2008/04/16/ntext-vs-nvarcharmax-in-sql-2005.aspx
&lt;/em&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Bob, I used to live in Fountain Hills and we met once or twice to talk shop. The org I work for is in the process of converting our existing SQL 2005 data from ASCII to Unicode.  It has been mostly &#8220;search and replace&#8221;, so far. Not fun, but not too hard, if you are fluent in regular expressions. ;-)<br />
Just a side note: You mention &#8220;NText rather than Text&#8221;. If you are using SQL 2005/2008, NTEXT has been deprecated; You should now use NVARCHAR(MAX), instead.</p>
<p><em>Bob responds:</p>
<p>Hi, Tod.  Thanks for the tip, I had not noticed that deprecation (largely because I don&#8217;t have any current projects that actually need Unicode).  I did a little research and found this interesting and helpful link that deals with a little &#8220;gotcha&#8221; when converting legacy ntext to nvarchar(max) and also documents the fact that SQL 2005+ has much worse performance with ntext than previous versions:</p>
<p><a href="http://geekswithblogs.net/johnsPerfBlog/archive/2008/04/16/ntext-vs-nvarcharmax-in-sql-2005.aspx" rel="nofollow">http://geekswithblogs.net/johnsPerfBlog/archive/2008/04/16/ntext-vs-nvarcharmax-in-sql-2005.aspx</a><br />
</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Three Ways to Clear a StringBuilder by James Radford, Web Developer</title>
		<link>http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/comment-page-1/#comment-9552</link>
		<dc:creator>James Radford, Web Developer</dc:creator>
		<pubDate>Tue, 08 Jun 2010 14:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/#comment-9552</guid>
		<description>thanks for the post..  Is this not okay?  

StringBuilder sb = new StringBuilder();
sb.Append(&quot;hello&quot;);
sb = new StringBuilder();

&lt;em&gt;Bob responds:
Presumably newing up another instance is more expensive than simply clearing the buffer of an existing one.  Also, creating new instances and abandoning old ones probably means more memory fragmentation and would tend to run the garbage collector more.  Can&#039;t say that I&#039;ve tested it, though, and one&#039;s mileage would vary depending on usage patterns.  Always remember, most of this discussion ends up not mattering all that much in terms of performance unless you&#039;re in a tight loop with many iterations, and then, of course, it&#039;s best to verify your assumptions with testing.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>thanks for the post..  Is this not okay?  </p>
<p>StringBuilder sb = new StringBuilder();<br />
sb.Append(&#8221;hello&#8221;);<br />
sb = new StringBuilder();</p>
<p><em>Bob responds:<br />
Presumably newing up another instance is more expensive than simply clearing the buffer of an existing one.  Also, creating new instances and abandoning old ones probably means more memory fragmentation and would tend to run the garbage collector more.  Can&#8217;t say that I&#8217;ve tested it, though, and one&#8217;s mileage would vary depending on usage patterns.  Always remember, most of this discussion ends up not mattering all that much in terms of performance unless you&#8217;re in a tight loop with many iterations, and then, of course, it&#8217;s best to verify your assumptions with testing.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on State Secrets: Place Names in Databases, News Story Bylines, and Elsewhere by Jim Spice</title>
		<link>http://bobondevelopment.com/2010/04/09/state-secrets-place-names-in-databases-news-story-bylines-and-elsewhere/comment-page-1/#comment-9503</link>
		<dc:creator>Jim Spice</dc:creator>
		<pubDate>Tue, 13 Apr 2010 18:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/?p=170#comment-9503</guid>
		<description>And don&#039;t forget to go with AC, not DC, VHS, not Betamax and Bluray, not HDDVD.</description>
		<content:encoded><![CDATA[<p>And don&#8217;t forget to go with AC, not DC, VHS, not Betamax and Bluray, not HDDVD.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Three Ways to Clear a StringBuilder by nemo</title>
		<link>http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/comment-page-1/#comment-9457</link>
		<dc:creator>nemo</dc:creator>
		<pubDate>Tue, 08 Dec 2009 17:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/#comment-9457</guid>
		<description>Nice tips! 

To expand it even further, in .NET 3.5 (not sure which version it was introduced) you can create an expanded method as such:

		public static void Clear(this StringBuilder stringBuilder)
		{
			stringBuilder.Length = 0;
			stringBuilder.Capacity = 16;
		}

now when you create your stringbuilder you can call it normally.  For example:
  StringBuilder sb = new StringBuilder();
  sb.Clear();

&lt;em&gt;Bob responds:

Thanks, excellent point.  Depending on the reuse pattern, resetting Capacity back to the default of 16 bytes may or may not be desirable, because re-expanding capacity is expensive.  It may make sense to leave it alone, or set it to a larger value than 16.  So my impulse would be to default to leaving it be, and taking an optional argument to set it to a specific value.

To this end -- 3.5 introduces a Clear() method anyway, and while it&#039;s not documented what, if anything it does to the Capacity value, if it leaves it alone, creating an extension method that sets it to a specific value might be a useful enhancement.
&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>Nice tips! </p>
<p>To expand it even further, in .NET 3.5 (not sure which version it was introduced) you can create an expanded method as such:</p>
<p>		public static void Clear(this StringBuilder stringBuilder)<br />
		{<br />
			stringBuilder.Length = 0;<br />
			stringBuilder.Capacity = 16;<br />
		}</p>
<p>now when you create your stringbuilder you can call it normally.  For example:<br />
  StringBuilder sb = new StringBuilder();<br />
  sb.Clear();</p>
<p><em>Bob responds:</p>
<p>Thanks, excellent point.  Depending on the reuse pattern, resetting Capacity back to the default of 16 bytes may or may not be desirable, because re-expanding capacity is expensive.  It may make sense to leave it alone, or set it to a larger value than 16.  So my impulse would be to default to leaving it be, and taking an optional argument to set it to a specific value.</p>
<p>To this end &#8212; 3.5 introduces a Clear() method anyway, and while it&#8217;s not documented what, if anything it does to the Capacity value, if it leaves it alone, creating an extension method that sets it to a specific value might be a useful enhancement.<br />
</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Kindle DX &#8212; Is it Worth the Money? by Tweets that mention The Kindle DX — Is it Worth the Money? — Bob On Development -- Topsy.com</title>
		<link>http://bobondevelopment.com/2009/11/19/the-kindle-dx-is-it-worth-the-money/comment-page-1/#comment-9409</link>
		<dc:creator>Tweets that mention The Kindle DX — Is it Worth the Money? — Bob On Development -- Topsy.com</dc:creator>
		<pubDate>Thu, 19 Nov 2009 21:37:14 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/?p=143#comment-9409</guid>
		<description>[...] This post was mentioned on Twitter by Kindle Lover, Kindle DX. Kindle DX said: The Kindle DX — Is it Worth the Money? — Bob On Development http://bit.ly/iN6ib [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Kindle Lover, Kindle DX. Kindle DX said: The Kindle DX — Is it Worth the Money? — Bob On Development <a href="http://bit.ly/iN6ib" rel="nofollow">http://bit.ly/iN6ib</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Three Ways to Clear a StringBuilder by turdy</title>
		<link>http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/comment-page-1/#comment-9403</link>
		<dc:creator>turdy</dc:creator>
		<pubDate>Wed, 18 Nov 2009 14:50:54 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/#comment-9403</guid>
		<description>Lovely tip thanks</description>
		<content:encoded><![CDATA[<p>Lovely tip thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Most Popular Posts by Becky</title>
		<link>http://bobondevelopment.com/most-popular-posts/comment-page-1/#comment-9312</link>
		<dc:creator>Becky</dc:creator>
		<pubDate>Thu, 15 Oct 2009 22:19:52 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/most-popular-posts/#comment-9312</guid>
		<description>Excellent stuff, Bob. Codebob. :)</description>
		<content:encoded><![CDATA[<p>Excellent stuff, Bob. Codebob. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Death of Microsoft is Greatly Exaggerated by JeffDevVb</title>
		<link>http://bobondevelopment.com/2007/04/07/the-death-of-microsoft-is-greatly-exaggerated/comment-page-1/#comment-9311</link>
		<dc:creator>JeffDevVb</dc:creator>
		<pubDate>Mon, 12 Oct 2009 19:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/04/07/the-death-of-microsoft-is-greatly-exaggerated/#comment-9311</guid>
		<description>Its funny to hear someone call the market leader in almost all aspects of programing and development tools ...Dead.  Even their desktop OS&#039;s have the lion&#039;s share of the market, can anyone dispute those facts. I&#039;m down with saying they are overly aggressive in maintaining their business model and could use taking down a notch or 3 but right now sending in any competitor to tackle them is like asking Tiny Tim to get that 800lb. Gorilla in a headlock...It isn&#039;t happening in the foreseeable future.</description>
		<content:encoded><![CDATA[<p>Its funny to hear someone call the market leader in almost all aspects of programing and development tools &#8230;Dead.  Even their desktop OS&#8217;s have the lion&#8217;s share of the market, can anyone dispute those facts. I&#8217;m down with saying they are overly aggressive in maintaining their business model and could use taking down a notch or 3 but right now sending in any competitor to tackle them is like asking Tiny Tim to get that 800lb. Gorilla in a headlock&#8230;It isn&#8217;t happening in the foreseeable future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Three Ways to Clear a StringBuilder by William</title>
		<link>http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/comment-page-1/#comment-7307</link>
		<dc:creator>William</dc:creator>
		<pubDate>Wed, 12 Nov 2008 22:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://bobondevelopment.com/2007/06/11/three-ways-to-clear-a-stringbuilder/#comment-7307</guid>
		<description>One last thing:

Just because it&#039;s small doesn&#039;t mean it doesn&#039;t matter (or at least that&#039;s what my gf tells me).

If you save 16 bytes or 2MB, it may seem small until you multiply it by the number of users. 

Consider the user count of say Mysp@ce or M$ or the NY Stock Exchange.

&lt;em&gt;Bob responds: There is a balance between thrashing and a stable state to consider.  I am simply saying that with a single StringBuilder, if you expect to construct strings of say 50 to 100 bytes, with the majority toward the top end, set an initial capacity of 100 and leave it alone.  Destroy the StringBuilder when you are done with it.  This is better and simpler in almost all real world cases than tamping the capacity back down, unless actual testing reveals a clear advantage, which I predict it won&#039;t.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>One last thing:</p>
<p>Just because it&#8217;s small doesn&#8217;t mean it doesn&#8217;t matter (or at least that&#8217;s what my gf tells me).</p>
<p>If you save 16 bytes or 2MB, it may seem small until you multiply it by the number of users. </p>
<p>Consider the user count of say Mysp@ce or M$ or the NY Stock Exchange.</p>
<p><em>Bob responds: There is a balance between thrashing and a stable state to consider.  I am simply saying that with a single StringBuilder, if you expect to construct strings of say 50 to 100 bytes, with the majority toward the top end, set an initial capacity of 100 and leave it alone.  Destroy the StringBuilder when you are done with it.  This is better and simpler in almost all real world cases than tamping the capacity back down, unless actual testing reveals a clear advantage, which I predict it won&#8217;t.</em></p>
]]></content:encoded>
	</item>
</channel>
</rss>
