<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Book Review of &#8220;The ThoughtWorks Anthology: Essays on Software Technology and Innovation&#8221;</title>
	<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/</link>
	<description>Productivity in software development</description>
	<pubDate>Sun, 12 Oct 2008 23:57:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: basic pooker instructions</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-161501</link>
		<dc:creator>basic pooker instructions</dc:creator>
		<pubDate>Thu, 04 Sep 2008 14:58:51 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-161501</guid>
		<description>&lt;strong&gt;basic pooker instructions...&lt;/strong&gt;

shielded:gasser circumvented!purports:overwriting!esteemed:...</description>
		<content:encoded><![CDATA[<p><strong>basic pooker instructions&#8230;</strong></p>
<p>shielded:gasser circumvented!purports:overwriting!esteemed:&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lowell</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-84834</link>
		<dc:creator>Lowell</dc:creator>
		<pubDate>Mon, 05 May 2008 01:32:13 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-84834</guid>
		<description>If you are using Java 6, there is a new method: String.isEmpty(). You could use that in your Java example and then you wouldn't need to write your own.</description>
		<content:encoded><![CDATA[<p>If you are using Java 6, there is a new method: String.isEmpty(). You could use that in your Java example and then you wouldn&#8217;t need to write your own.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-81201</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Mon, 28 Apr 2008 04:53:14 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-81201</guid>
		<description>I took a look at &lt;code&gt;new String()&lt;/code&gt;, they do a array copy, perhaps because otherwise a larger String from which a substring was created could not be reclaimed by GC.</description>
		<content:encoded><![CDATA[<p>I took a look at <code>new String()</code>, they do a array copy, perhaps because otherwise a larger String from which a substring was created could not be reclaimed by GC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-81197</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Mon, 28 Apr 2008 04:16:41 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-81197</guid>
		<description>Thanks for looking, it does create a new String. What I meant was that it would create a new String object but do not copy and use a new character array but reuse the old one, just with different pointers to beginning and end. Because String is immutable this would work.</description>
		<content:encoded><![CDATA[<p>Thanks for looking, it does create a new String. What I meant was that it would create a new String object but do not copy and use a new character array but reuse the old one, just with different pointers to beginning and end. Because String is immutable this would work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lumpynose</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-81182</link>
		<dc:creator>lumpynose</dc:creator>
		<pubDate>Mon, 28 Apr 2008 03:12:40 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-81182</guid>
		<description>"trim() probably does not create a new String in Java" is that a typo?  Since Strings are immutable I'd think that the obvious conclusion is that it would have to create a new String.

And if you look at the source, trim() calls substring(), which ends with

[pre]
	return ((beginIndex == 0) &#38;&#38; (endIndex == count)) ? this :
	    new String(offset   beginIndex, endIndex - beginIndex, value);
[/pre]</description>
		<content:encoded><![CDATA[<p>&#8220;trim() probably does not create a new String in Java&#8221; is that a typo?  Since Strings are immutable I&#8217;d think that the obvious conclusion is that it would have to create a new String.</p>
<p>And if you look at the source, trim() calls substring(), which ends with</p>
<p>[pre]<br />
	return ((beginIndex == 0) &amp;&amp; (endIndex == count)) ? this :<br />
	    new String(offset   beginIndex, endIndex - beginIndex, value);<br />
[/pre]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80915</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Sun, 27 Apr 2008 18:13:39 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80915</guid>
		<description>Yes, as I've wrote:

"(which has other performance and memory characteristics)."

&lt;code&gt;trim()&lt;/code&gt; probably does not create a new String in Java, because Strings are immutable (I know Reflection yaddayadda).</description>
		<content:encoded><![CDATA[<p>Yes, as I&#8217;ve wrote:</p>
<p>&#8220;(which has other performance and memory characteristics).&#8221;</p>
<p><code>trim()</code> probably does not create a new String in Java, because Strings are immutable (I know Reflection yaddayadda).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lumpynose</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80914</link>
		<dc:creator>lumpynose</dc:creator>
		<pubDate>Sun, 27 Apr 2008 18:11:08 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80914</guid>
		<description>To add to what vr said, another thing to think about is that Commons Lang isblank() is a library routine which is probably used a lot; I use it all the time.  Its code is clean, simple, and straightforward so it will be easy to maintain.  It may not be "pretty" from the perspective of a Ruby programmer, but like vr says, it's maximally efficient.

Speed is still a significant issue with Ruby, perhaps because there is too much "pretty" Ruby code that's inefficient.</description>
		<content:encoded><![CDATA[<p>To add to what vr said, another thing to think about is that Commons Lang isblank() is a library routine which is probably used a lot; I use it all the time.  Its code is clean, simple, and straightforward so it will be easy to maintain.  It may not be &#8220;pretty&#8221; from the perspective of a Ruby programmer, but like vr says, it&#8217;s maximally efficient.</p>
<p>Speed is still a significant issue with Ruby, perhaps because there is too much &#8220;pretty&#8221; Ruby code that&#8217;s inefficient.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80600</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Sat, 26 Apr 2008 23:59:10 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80600</guid>
		<description>As I've wrote &lt;i&gt;(which has other performance and memory characteristics)&lt;/i&gt;.

"[...] results in creation of a new String object,  [...]"

I know, see above.

"[...] , is more efficient [...]"

I know, see above.</description>
		<content:encoded><![CDATA[<p>As I&#8217;ve wrote <i>(which has other performance and memory characteristics)</i>.</p>
<p>&#8220;[&#8230;] results in creation of a new String object,  [&#8230;]&#8221;</p>
<p>I know, see above.</p>
<p>&#8220;[&#8230;] , is more efficient [&#8230;]&#8221;</p>
<p>I know, see above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vr</title>
		<link>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80594</link>
		<dc:creator>vr</dc:creator>
		<pubDate>Sat, 26 Apr 2008 23:43:06 +0000</pubDate>
		<guid>http://stephan.reposita.org/archives/2008/04/25/review-of-the-thoughtworks-anthology-essays-on-software-technology/#comment-80594</guid>
		<description>I would not be as quick to brand isBlank() as an example of bad code. It's a static utility method and it is only required to do what it is asked for, but with a maximum possible efficiency. Indeed, the for-loop would look a bit ugly to a stranger, but strangers don't look inside the code, they would just use it, unless they have the urge to criticize or a sudden curiosity attack. 

See, your suggested "substitute" calls String's trim, which (a) has TWO loops (to check from the beginning and the end of the String; (b) considers any symbol with a code lass than '  ' to be a whitespace, which is not what isBlank() doing (it is more strict and sticks to Unicode definition of whitespace). Not only that, a call to your string.trim() results in creation of a new String object, which you're almost certainly not going to use (unless it _is_ blank and it gets cached by VM in the String pool). Think again: isBlank() does exactly what it was asked for, is more efficient and you don't have to think about all of the above, unless you're that wonderful essay author or just a reader with brain somewhat disturbed by essay's content.</description>
		<content:encoded><![CDATA[<p>I would not be as quick to brand isBlank() as an example of bad code. It&#8217;s a static utility method and it is only required to do what it is asked for, but with a maximum possible efficiency. Indeed, the for-loop would look a bit ugly to a stranger, but strangers don&#8217;t look inside the code, they would just use it, unless they have the urge to criticize or a sudden curiosity attack. </p>
<p>See, your suggested &#8220;substitute&#8221; calls String&#8217;s trim, which (a) has TWO loops (to check from the beginning and the end of the String; (b) considers any symbol with a code lass than &#8216;  &#8216; to be a whitespace, which is not what isBlank() doing (it is more strict and sticks to Unicode definition of whitespace). Not only that, a call to your string.trim() results in creation of a new String object, which you&#8217;re almost certainly not going to use (unless it _is_ blank and it gets cached by VM in the String pool). Think again: isBlank() does exactly what it was asked for, is more efficient and you don&#8217;t have to think about all of the above, unless you&#8217;re that wonderful essay author or just a reader with brain somewhat disturbed by essay&#8217;s content.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
