<?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 on: Stop With The Dreaded f blocks.</title>
	<atom:link href="http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/feed/" rel="self" type="application/rss+xml" />
	<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/</link>
	<description>Blog of the designer/developer Zach Inglis.</description>
	<pubDate>Mon, 01 Dec 2008 20:07:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: a95985c0a08e</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4729</link>
		<dc:creator>a95985c0a08e</dc:creator>
		<pubDate>Tue, 13 May 2008 18:00:28 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4729</guid>
		<description>&lt;strong&gt;a95985c0a08e...&lt;/strong&gt;

a95985c0a08ef9fc7893...</description>
		<content:encoded><![CDATA[<p><strong>a95985c0a08e&#8230;</strong></p>
<p>a95985c0a08ef9fc7893&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nico</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4588</link>
		<dc:creator>Nico</dc:creator>
		<pubDate>Sat, 05 Apr 2008 17:42:18 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4588</guid>
		<description>I found your blog via Google while searching for effexor xanax and your post regarding th The Dreaded f blocks. at ZachInglis.com looks very interesting to me.I just just wanted to drop you a note telling you how impressed I was with the information you have posted here. I also have websites &#38; blogs  so I know what I am talking about when I say your site is top-notch! Keep up the great work, you are providing a great resource on the Internet here!</description>
		<content:encoded><![CDATA[<p>I found your blog via Google while searching for effexor xanax and your post regarding th The Dreaded f blocks. at ZachInglis.com looks very interesting to me.I just just wanted to drop you a note telling you how impressed I was with the information you have posted here. I also have websites &amp; blogs  so I know what I am talking about when I say your site is top-notch! Keep up the great work, you are providing a great resource on the Internet here!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Inglis</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4243</link>
		<dc:creator>Zach Inglis</dc:creator>
		<pubDate>Fri, 01 Feb 2008 08:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4243</guid>
		<description>Piers. I appreciate the argument from BOTH sides of the fence.

I appreciate your last paragraph the most, I think that sums up my opinion the most and I whole-heartedly agree. That is what I have an issue with, it doesn't express anything as a simple letter doesn't necessarily mean anything, unless you look at the context. On one argument, it's standard and most people know that f represents a form.

Saying that, I am not opposed to something like i for index. Maybe because I've ALWAYS known it to be that, and it's not just Ruby that does it.</description>
		<content:encoded><![CDATA[<p>Piers. I appreciate the argument from BOTH sides of the fence.</p>
<p>I appreciate your last paragraph the most, I think that sums up my opinion the most and I whole-heartedly agree. That is what I have an issue with, it doesn&#8217;t express anything as a simple letter doesn&#8217;t necessarily mean anything, unless you look at the context. On one argument, it&#8217;s standard and most people know that f represents a form.</p>
<p>Saying that, I am not opposed to something like i for index. Maybe because I&#8217;ve ALWAYS known it to be that, and it&#8217;s not just Ruby that does it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piers Cawley</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4242</link>
		<dc:creator>Piers Cawley</dc:creator>
		<pubDate>Fri, 01 Feb 2008 08:32:27 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4242</guid>
		<description>&lt;code&gt;make&lt;/code&gt; has a certain logic to it, along the same lines as &lt;code&gt;each&lt;/code&gt;.

@Ben: Hang your head in shame! Actually, that code makes a good argument for using &lt;code&gt;form&lt;/code&gt; throughout, that way, when you extract a chunk of code into a partial (which you will, inevitably, call &lt;code&gt;form&lt;/code&gt;, you can magically pass it an appropriately named local variable by doing &lt;code&gt;render :partial =&#62; 'form', :object =&#62; 'form'&lt;/code&gt;. Obviously, any subsequent partials will need a &lt;code&gt;:locals&lt;/code&gt; hash, but I'm not sure that happens as often.

@Zach: Use of abbreviations doesn't have to be a slippery slope: the folks who slide down it would probably slide down some other slope anyway. 

The key question anyone should ask themselves of their code is "Does this express my intention clearly", sometimes a judiciously chosen abbreviation helps, at other times it hinders.</description>
		<content:encoded><![CDATA[<p><code>make</code> has a certain logic to it, along the same lines as <code>each</code>.</p>
<p>@Ben: Hang your head in shame! Actually, that code makes a good argument for using <code>form</code> throughout, that way, when you extract a chunk of code into a partial (which you will, inevitably, call <code>form</code>, you can magically pass it an appropriately named local variable by doing <code>render :partial =&gt; 'form', :object =&gt; 'form'</code>. Obviously, any subsequent partials will need a <code>:locals</code> hash, but I&#8217;m not sure that happens as often.</p>
<p>@Zach: Use of abbreviations doesn&#8217;t have to be a slippery slope: the folks who slide down it would probably slide down some other slope anyway. </p>
<p>The key question anyone should ask themselves of their code is &#8220;Does this express my intention clearly&#8221;, sometimes a judiciously chosen abbreviation helps, at other times it hinders.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Wilden</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4240</link>
		<dc:creator>Mark Wilden</dc:creator>
		<pubDate>Thu, 31 Jan 2008 22:01:34 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4240</guid>
		<description>Sorry, guys, but using f as the form variable in Rails is just as standard as using i and j as loop variables in C (etc.). If it's confusing, then the code it's in is doing too much.

As for the overuse of abbreviations in general, that's another blog post. But I never avoid a good practice because it can (theoretically) lead to a bad practice.

///ark</description>
		<content:encoded><![CDATA[<p>Sorry, guys, but using f as the form variable in Rails is just as standard as using i and j as loop variables in C (etc.). If it&#8217;s confusing, then the code it&#8217;s in is doing too much.</p>
<p>As for the overuse of abbreviations in general, that&#8217;s another blog post. But I never avoid a good practice because it can (theoretically) lead to a bad practice.</p>
<p>///ark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Inglis</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4238</link>
		<dc:creator>Zach Inglis</dc:creator>
		<pubDate>Thu, 31 Jan 2008 14:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4238</guid>
		<description>I agree somewhat.

F is not an awful abbreviation but I seem to find that once people start abbreviating often, their code gets sloppy and they abbreviate too often. Also, you only know what &lt;code&gt;f&lt;/code&gt; when you know the code, which seems anti-Ruby to me. Ruby was always meant that you could just pick up a document and read it to know what it does. I personally use &lt;code&gt;make&lt;/code&gt; instead of &lt;code&gt;f&lt;/code&gt; for forms. It makes more sense in my mind.

Ben has the perfect example of what I mean, and to me it feels like the Rails Core code is littered with those examples.</description>
		<content:encoded><![CDATA[<p>I agree somewhat.</p>
<p>F is not an awful abbreviation but I seem to find that once people start abbreviating often, their code gets sloppy and they abbreviate too often. Also, you only know what <code>f</code> when you know the code, which seems anti-Ruby to me. Ruby was always meant that you could just pick up a document and read it to know what it does. I personally use <code>make</code> instead of <code>f</code> for forms. It makes more sense in my mind.</p>
<p>Ben has the perfect example of what I mean, and to me it feels like the Rails Core code is littered with those examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4237</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 31 Jan 2008 13:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4237</guid>
		<description>I'm with Piers - this isn't too harmful, as long as you're consistent. Regarding passing f to a form partial, though, I have seen (and, I admit it, written) this monstrosity:

&#60;%= render :partial =&#62; 'form', :locals =&#62; {:f =&#62; f} %&#62;

I weep for the state of the world, with people (like me) who write this in it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Piers - this isn&#8217;t too harmful, as long as you&#8217;re consistent. Regarding passing f to a form partial, though, I have seen (and, I admit it, written) this monstrosity:</p>
<p>&lt;%= render :partial =&gt; &#8216;form&#8217;, :locals =&gt; {:f =&gt; f} %&gt;</p>
<p>I weep for the state of the world, with people (like me) who write this in it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piers Cawley</title>
		<link>http://zachinglis.com/2008/coding/rails-coding/stop-with-the-dreaded-f-blocks/#comment-4236</link>
		<dc:creator>Piers Cawley</dc:creator>
		<pubDate>Thu, 31 Jan 2008 10:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://zachinglis.com/2008/coding/rails/stop-with-the-dreaded-f-blocks/#comment-4236</guid>
		<description>It's just an extension of Kent Beck's pattern for naming the temporary variable in a Smalltalk &lt;code&gt;do:&lt;/code&gt; block - always call it &lt;code&gt;each&lt;/code&gt;, if the block gets complicated enough that you want to change the name, it's time to extract a method and just call that in the block.

In &lt;code&gt;form_for&lt;/code&gt;'s case, &lt;code&gt;f&lt;/code&gt; doesn't seem like an awful choice, though I suppose there's a case for &lt;code&gt;form&lt;/code&gt;, otherwise the same rule applies - if the body of the form gets complicated enough that you want a more meaningful name for it, use a partial and pass &lt;code&gt;f&lt;/code&gt; in as its &lt;code&gt;:object&lt;/code&gt;.

In the Hpricot example, I'd be more inclined to use &lt;code&gt;it&lt;/code&gt;, or possibly &lt;code&gt;each&lt;/code&gt;, but mileage varies. 

The rule of thumb is to standardize on particular parameter names in blocks of different points and, when you start to feel the pain of not having a descriptive parameter name, extract a method and give that a meaningful parameter name (or, better, make it a method of &lt;code&gt;f&lt;/code&gt;'s class if you can).</description>
		<content:encoded><![CDATA[<p>It&#8217;s just an extension of Kent Beck&#8217;s pattern for naming the temporary variable in a Smalltalk <code>do:</code> block - always call it <code>each</code>, if the block gets complicated enough that you want to change the name, it&#8217;s time to extract a method and just call that in the block.</p>
<p>In <code>form_for</code>&#8217;s case, <code>f</code> doesn&#8217;t seem like an awful choice, though I suppose there&#8217;s a case for <code>form</code>, otherwise the same rule applies - if the body of the form gets complicated enough that you want a more meaningful name for it, use a partial and pass <code>f</code> in as its <code>:object</code>.</p>
<p>In the Hpricot example, I&#8217;d be more inclined to use <code>it</code>, or possibly <code>each</code>, but mileage varies. </p>
<p>The rule of thumb is to standardize on particular parameter names in blocks of different points and, when you start to feel the pain of not having a descriptive parameter name, extract a method and give that a meaningful parameter name (or, better, make it a method of <code>f</code>&#8217;s class if you can).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
