<?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"
	>
<channel>
	<title>Comments for trapdoor1</title>
	<atom:link href="http://blog.trapdoor1.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.trapdoor1.net</link>
	<description>rails, ruby, supercollider, dsp</description>
	<pubDate>Wed, 09 Jul 2008 13:05:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>Comment on Under the hood: Ruby&#8217;s global variables by Jay</title>
		<link>http://blog.trapdoor1.net/2008/05/04/under-the-hood-rubys-global-variables/#comment-40</link>
		<dc:creator>Jay</dc:creator>
		<pubDate>Mon, 12 May 2008 06:48:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=31#comment-40</guid>
		<description>My version of the Pickaxe shows $FILENAME is the name of the current input file, $, is the separator string output between parameters such as print and join.  $+ is for pattern matching, and returns the contents of the highest-numbered group matched following a successful pattern match (last match in a group of successful matches I guess?).  Dunno about $binding though....</description>
		<content:encoded><![CDATA[<p>My version of the Pickaxe shows $FILENAME is the name of the current input file, $, is the separator string output between parameters such as print and join.  $+ is for pattern matching, and returns the contents of the highest-numbered group matched following a successful pattern match (last match in a group of successful matches I guess?).  Dunno about $binding though&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why I am switching to test-driven development by Julian</title>
		<link>http://blog.trapdoor1.net/2008/05/10/why-i-am-switching-to-test-driven-development/#comment-39</link>
		<dc:creator>Julian</dc:creator>
		<pubDate>Sun, 11 May 2008 07:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=38#comment-39</guid>
		<description>Go for it!
I don't necessarily write tests first, but I am writing tests very closely with changes. I find also that the TDD approach supports the design of nice contracts, as you're thinking about how to use your API as well, so method names tend to end up more user-friendly as well (I'm not afraid of 200+ char methods if it is the shortest way of concisely describing what the method does). 

It also helps make it clear what the methods actually do. I know of a bunch of methods in a certain code base ;) that ... well it's taking me a long time to figure exactly what they do and what tests to write for them.</description>
		<content:encoded><![CDATA[<p>Go for it!<br />
I don&#8217;t necessarily write tests first, but I am writing tests very closely with changes. I find also that the TDD approach supports the design of nice contracts, as you&#8217;re thinking about how to use your API as well, so method names tend to end up more user-friendly as well (I&#8217;m not afraid of 200+ char methods if it is the shortest way of concisely describing what the method does). </p>
<p>It also helps make it clear what the methods actually do. I know of a bunch of methods in a certain code base ;) that &#8230; well it&#8217;s taking me a long time to figure exactly what they do and what tests to write for them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Storing Rails&#8217; Flash object throughout multiple redirects by robin</title>
		<link>http://blog.trapdoor1.net/2008/04/24/storing-rails-flash-object-throughout-multiple-redirects/#comment-37</link>
		<dc:creator>robin</dc:creator>
		<pubDate>Fri, 09 May 2008 13:11:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=26#comment-37</guid>
		<description>No problem. I worked it out but didn't think it needed a full write-up... it probably is useful though, so cheers.

Very useful methods anyway... I'd hacked some really quite unpleasant solutions to that little problem before I discovered them.</description>
		<content:encoded><![CDATA[<p>No problem. I worked it out but didn&#8217;t think it needed a full write-up&#8230; it probably is useful though, so cheers.</p>
<p>Very useful methods anyway&#8230; I&#8217;d hacked some really quite unpleasant solutions to that little problem before I discovered them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Storing Rails&#8217; Flash object throughout multiple redirects by Kristian Domagala</title>
		<link>http://blog.trapdoor1.net/2008/04/24/storing-rails-flash-object-throughout-multiple-redirects/#comment-36</link>
		<dc:creator>Kristian Domagala</dc:creator>
		<pubDate>Fri, 09 May 2008 04:54:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=26#comment-36</guid>
		<description>I'm having trouble figuring out (from what you've written) whether or not you've solved this problem for yourself, so please ignore this if you have.

I ran into the exact same issue today, and after following the link from your post above, I found the solution in the form of the "keep" method. 

In my case, I have three actions; a, b &#38; c, where a redirects to b with a flash message, and b redirects to c. By default, the flash message is lost by the time c is rendered. 

To get around the problem, I changed action 'b' as follows:

  def b
    ...
    flash.keep
    redirect_to :action =&#62; :b
  end

Now when c is rendered, the message set in a is present.

Thanks anyway for the link!</description>
		<content:encoded><![CDATA[<p>I&#8217;m having trouble figuring out (from what you&#8217;ve written) whether or not you&#8217;ve solved this problem for yourself, so please ignore this if you have.</p>
<p>I ran into the exact same issue today, and after following the link from your post above, I found the solution in the form of the &#8220;keep&#8221; method. </p>
<p>In my case, I have three actions; a, b &amp; c, where a redirects to b with a flash message, and b redirects to c. By default, the flash message is lost by the time c is rendered. </p>
<p>To get around the problem, I changed action &#8216;b&#8217; as follows:</p>
<p>  def b<br />
    &#8230;<br />
    flash.keep<br />
    redirect_to :action =&gt; :b<br />
  end</p>
<p>Now when c is rendered, the message set in a is present.</p>
<p>Thanks anyway for the link!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby, from the perspective of SuperCollider by robin</title>
		<link>http://blog.trapdoor1.net/2008/05/07/ruby-from-the-perspective-of-supercollider/#comment-30</link>
		<dc:creator>robin</dc:creator>
		<pubDate>Wed, 07 May 2008 20:37:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=33#comment-30</guid>
		<description>Hehe, a fair point. I meant to go deeper into the pro's and con's of IDEs, but it didn't quite make it in.

I hear only good things about NetBeans. I really should give it a try. Watch this space.</description>
		<content:encoded><![CDATA[<p>Hehe, a fair point. I meant to go deeper into the pro&#8217;s and con&#8217;s of IDEs, but it didn&#8217;t quite make it in.</p>
<p>I hear only good things about NetBeans. I really should give it a try. Watch this space.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby, from the perspective of SuperCollider by Julian</title>
		<link>http://blog.trapdoor1.net/2008/05/07/ruby-from-the-perspective-of-supercollider/#comment-29</link>
		<dc:creator>Julian</dc:creator>
		<pubDate>Wed, 07 May 2008 20:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=33#comment-29</guid>
		<description>Great post Rob, really enjoyed it!

BTW, as I have said before, Netbeans is very impressive with full RoR and SVN support. It's at 6.1RCx now and it has great 'intellisense' behaviour for API lookup. It's really fast too. Don't forget to hold down the ctrl key and move the mouse over your code. Blue highlights appear on definitions it recognises. It has refactoring and everything. Just like java even... !</description>
		<content:encoded><![CDATA[<p>Great post Rob, really enjoyed it!</p>
<p>BTW, as I have said before, Netbeans is very impressive with full RoR and SVN support. It&#8217;s at 6.1RCx now and it has great &#8216;intellisense&#8217; behaviour for API lookup. It&#8217;s really fast too. Don&#8217;t forget to hold down the ctrl key and move the mouse over your code. Blue highlights appear on definitions it recognises. It has refactoring and everything. Just like java even&#8230; !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Under the hood: Ruby&#8217;s global variables by robin</title>
		<link>http://blog.trapdoor1.net/2008/05/04/under-the-hood-rubys-global-variables/#comment-27</link>
		<dc:creator>robin</dc:creator>
		<pubDate>Mon, 05 May 2008 08:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=31#comment-27</guid>
		<description>Cheers, updated.</description>
		<content:encoded><![CDATA[<p>Cheers, updated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Under the hood: Ruby&#8217;s global variables by Ola Bini</title>
		<link>http://blog.trapdoor1.net/2008/05/04/under-the-hood-rubys-global-variables/#comment-23</link>
		<dc:creator>Ola Bini</dc:creator>
		<pubDate>Sun, 04 May 2008 23:12:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=31#comment-23</guid>
		<description>Nice writeup.

$` and $' are the text before regexp match and text after regexp match, respectively.</description>
		<content:encoded><![CDATA[<p>Nice writeup.</p>
<p>$` and $&#8217; are the text before regexp match and text after regexp match, respectively.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Object.too_clever_by_half? rescue nil by Reg Braithwaite</title>
		<link>http://blog.trapdoor1.net/2008/04/05/object-too_clever_by_half-rescue-nil/#comment-5</link>
		<dc:creator>Reg Braithwaite</dc:creator>
		<pubDate>Mon, 07 Apr 2008 22:33:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=15#comment-5</guid>
		<description>Robin:

Well, in all fairness to KISS, what if a project suffers "The death of a thousand hacks"? IOW, Maybe #andand looks like a good idea. And so does #let (http://ick.rubyforge.org). And so does Symbol#to_proc. And so does X and Y and Z.

On a case-by-case basis, each may seem like a very good idea that has a positive ROI, is worth the time to learn.

But taken in aggregate, the code may be incomprehensible without serious study to learn each "idiom."

I don't know the answer to that one, it's a legitimate problem.</description>
		<content:encoded><![CDATA[<p>Robin:</p>
<p>Well, in all fairness to KISS, what if a project suffers &#8220;The death of a thousand hacks&#8221;? IOW, Maybe #andand looks like a good idea. And so does #let (http://ick.rubyforge.org). And so does Symbol#to_proc. And so does X and Y and Z.</p>
<p>On a case-by-case basis, each may seem like a very good idea that has a positive ROI, is worth the time to learn.</p>
<p>But taken in aggregate, the code may be incomprehensible without serious study to learn each &#8220;idiom.&#8221;</p>
<p>I don&#8217;t know the answer to that one, it&#8217;s a legitimate problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Object.too_clever_by_half? rescue nil by robin</title>
		<link>http://blog.trapdoor1.net/2008/04/05/object-too_clever_by_half-rescue-nil/#comment-4</link>
		<dc:creator>robin</dc:creator>
		<pubDate>Mon, 07 Apr 2008 08:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=15#comment-4</guid>
		<description>Reg, point taken - I wrote the list of links giving a broad overview. And then wrote the rest of the post, which went in a slightly different direction.

#andand isn't a good example to have there.</description>
		<content:encoded><![CDATA[<p>Reg, point taken - I wrote the list of links giving a broad overview. And then wrote the rest of the post, which went in a slightly different direction.</p>
<p>#andand isn&#8217;t a good example to have there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Object.too_clever_by_half? rescue nil by Eddie Welker</title>
		<link>http://blog.trapdoor1.net/2008/04/05/object-too_clever_by_half-rescue-nil/#comment-3</link>
		<dc:creator>Eddie Welker</dc:creator>
		<pubDate>Sun, 06 Apr 2008 03:07:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=15#comment-3</guid>
		<description>I agree with Reg, it does seem to me that #andand is trying to be both DRY and KISS.  To use it or not... it simply depends on the audience.  If you're at a ruby-familiar place, and understand what modifying Object means, that's fine.

I work with a ton of bright people but I'd feel guilty using it (despite liking it), because I would know I'd slow down the next guy when he read it. 

It's all just a case of various levels of compromise, and over an idiom at that.</description>
		<content:encoded><![CDATA[<p>I agree with Reg, it does seem to me that #andand is trying to be both DRY and KISS.  To use it or not&#8230; it simply depends on the audience.  If you&#8217;re at a ruby-familiar place, and understand what modifying Object means, that&#8217;s fine.</p>
<p>I work with a ton of bright people but I&#8217;d feel guilty using it (despite liking it), because I would know I&#8217;d slow down the next guy when he read it. </p>
<p>It&#8217;s all just a case of various levels of compromise, and over an idiom at that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Object.too_clever_by_half? rescue nil by Reg Braithwaite</title>
		<link>http://blog.trapdoor1.net/2008/04/05/object-too_clever_by_half-rescue-nil/#comment-2</link>
		<dc:creator>Reg Braithwaite</dc:creator>
		<pubDate>Sun, 06 Apr 2008 00:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.trapdoor1.net/?p=15#comment-2</guid>
		<description>First, I'm not sure why you mention Object#andand in the same breath as SafeNil. The former does not modify any exiting methods in either Object or in NilClass.

Second, I am confused by the example you give. There is NOTHING wrong with writing @person.name unless @person.nil?. The documentation for #andand specifically agrees  with you. This is because looking up @person is cheap and free of side effects.

Whereas, if you needed to do something expensive and/or something with side effects, you would have to manufacture an instance variable to memoize your operation.

The choice I face is when to write:

begin
  temp_person = Person.find(...)
  temp_person.name if temp_person
end

And when to write:

Person.find(...).andand.name

I am all for the former if you prefer it, if you find it easier to read or aunderstand, and if the idea of adding the method #andand to the Object class keeps you up late at night. It is much less invasive than changing the behaviour of NilClass, but if it's too much for you on principle, I have no problem with that.

But let's be clear on the use case. @person.name unless @person.nil is NOT the use case.

Finally, I cannot answer for anyone else. But I do think that for me, DRY is KISS. If you think Object#andand makes the code less simple, than I agree you should eschew it. But it is not intended to be a tool for making things DRY at the expense of KISS, it is inteded to make things DRY and simpler.</description>
		<content:encoded><![CDATA[<p>First, I&#8217;m not sure why you mention Object#andand in the same breath as SafeNil. The former does not modify any exiting methods in either Object or in NilClass.</p>
<p>Second, I am confused by the example you give. There is NOTHING wrong with writing @person.name unless @person.nil?. The documentation for #andand specifically agrees  with you. This is because looking up @person is cheap and free of side effects.</p>
<p>Whereas, if you needed to do something expensive and/or something with side effects, you would have to manufacture an instance variable to memoize your operation.</p>
<p>The choice I face is when to write:</p>
<p>begin<br />
  temp_person = Person.find(&#8230;)<br />
  temp_person.name if temp_person<br />
end</p>
<p>And when to write:</p>
<p>Person.find(&#8230;).andand.name</p>
<p>I am all for the former if you prefer it, if you find it easier to read or aunderstand, and if the idea of adding the method #andand to the Object class keeps you up late at night. It is much less invasive than changing the behaviour of NilClass, but if it&#8217;s too much for you on principle, I have no problem with that.</p>
<p>But let&#8217;s be clear on the use case. @person.name unless @person.nil is NOT the use case.</p>
<p>Finally, I cannot answer for anyone else. But I do think that for me, DRY is KISS. If you think Object#andand makes the code less simple, than I agree you should eschew it. But it is not intended to be a tool for making things DRY at the expense of KISS, it is inteded to make things DRY and simpler.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
