<?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: The most useful Monkeypatch ever</title>
	<atom:link href="http://weblog.masukomi.org/2008/03/08/the-most-useful-monkeypatch-ever/feed" rel="self" type="application/rss+xml" />
	<link>http://weblog.masukomi.org/2008/03/08/the-most-useful-monkeypatch-ever</link>
	<description>mah-soo-koh-me</description>
	<lastBuildDate>Sun, 01 Aug 2010 03:37:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stephen</title>
		<link>http://weblog.masukomi.org/2008/03/08/the-most-useful-monkeypatch-ever/comment-page-1#comment-41</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Fri, 14 Mar 2008 16:00:01 +0000</pubDate>
		<guid isPermaLink="false">http://weblog.masukomi.org/?p=4#comment-41</guid>
		<description>Emptiness == empty is a tautological argument, but I believe with some flaws. Emptiness is contained. A container can be empty. E.g.,

    nil.to_s == &quot;&quot;
    &quot;&quot;.empty? # =&gt; true

    nil.to_a == []
    [].empty? # =&gt; true

    Hash.new(nil) == {}
    {}.empty? # =&gt; true

Nil is being _contained_ by something in each case: a string, an array, a hash. The string, array, and hash are all empty. Nil is that emptiness. Nil itself is not empty because it cannot contain anything to begin with. Do you understand? The English definitions for &quot;empty&quot; and &quot;emptiness&quot; are different.</description>
		<content:encoded><![CDATA[<p>Emptiness == empty is a tautological argument, but I believe with some flaws. Emptiness is contained. A container can be empty. E.g.,</p>
<p>    nil.to_s == &#8220;&#8221;<br />
    &#8220;&#8221;.empty? # =&gt; true</p>
<p>    nil.to_a == []<br />
    [].empty? # =&gt; true</p>
<p>    Hash.new(nil) == {}<br />
    {}.empty? # =&gt; true</p>
<p>Nil is being _contained_ by something in each case: a string, an array, a hash. The string, array, and hash are all empty. Nil is that emptiness. Nil itself is not empty because it cannot contain anything to begin with. Do you understand? The English definitions for &#8220;empty&#8221; and &#8220;emptiness&#8221; are different.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: masukomi</title>
		<link>http://weblog.masukomi.org/2008/03/08/the-most-useful-monkeypatch-ever/comment-page-1#comment-40</link>
		<dc:creator>masukomi</dc:creator>
		<pubDate>Fri, 14 Mar 2008 15:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://weblog.masukomi.org/?p=4#comment-40</guid>
		<description>Yeah, I was contemplating the SQL issue when I wrote this *BUT* I don&#039;t see this as a problem because in Ruby null really does connote a void. The problem, as I see it, is that SQL has 3 states populated, empty, and null but ActiveRecord isn&#039;t returning you an object that accurately represents that. It&#039;ll return you the thing or null. .blank? may make sense in Rails, but AFAIK it still doesn&#039;t address the issue of things being nil. And, while you do need a difference between NULL and blank when querying, for almost all practical purposes they&#039;re the same once you&#039;ve gotten your results.

As far as basing it on English definitions. Yes, I am, because Ruby is written in English and uses English words to name its pieces. As far as nil being &quot;emptyness&quot; not &quot;empty&quot;, how can emptyness NOT be empty?</description>
		<content:encoded><![CDATA[<p>Yeah, I was contemplating the SQL issue when I wrote this *BUT* I don&#8217;t see this as a problem because in Ruby null really does connote a void. The problem, as I see it, is that SQL has 3 states populated, empty, and null but ActiveRecord isn&#8217;t returning you an object that accurately represents that. It&#8217;ll return you the thing or null. .blank? may make sense in Rails, but AFAIK it still doesn&#8217;t address the issue of things being nil. And, while you do need a difference between NULL and blank when querying, for almost all practical purposes they&#8217;re the same once you&#8217;ve gotten your results.</p>
<p>As far as basing it on English definitions. Yes, I am, because Ruby is written in English and uses English words to name its pieces. As far as nil being &#8220;emptyness&#8221; not &#8220;empty&#8221;, how can emptyness NOT be empty?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://weblog.masukomi.org/2008/03/08/the-most-useful-monkeypatch-ever/comment-page-1#comment-39</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Fri, 14 Mar 2008 14:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://weblog.masukomi.org/?p=4#comment-39</guid>
		<description>This argument is less than sound. You&#039;re arguing based on English definitions, not code definitions. But even so, `nil` is not _empty_, `nil` is _emptiness_.

Here&#039;s some more counterpoint:

A `NULL` field in SQL doesn&#039;t connote a void, but rather a _blank_, undefined state. `nil.blank?` makes sense and is defined by Rails because those fields can be `NULL` or empty strings, but usually connote the same thing. `@user.name.blank?` makes sense (and should return `true` if `nil` _or_ `&quot;&quot;`), `@user.name.empty?` does not.

Save `empty?` for things that can be empty: Arrays and Hashes, `[]` and `{}`. Certain methods should return arrays or hashes, empty or &quot;full&quot;, and if it&#039;s returning `nil`, that&#039;s a problem that should fail out when `empty?` is called on the object.</description>
		<content:encoded><![CDATA[<p>This argument is less than sound. You&#8217;re arguing based on English definitions, not code definitions. But even so, `nil` is not _empty_, `nil` is _emptiness_.</p>
<p>Here&#8217;s some more counterpoint:</p>
<p>A `NULL` field in SQL doesn&#8217;t connote a void, but rather a _blank_, undefined state. `nil.blank?` makes sense and is defined by Rails because those fields can be `NULL` or empty strings, but usually connote the same thing. `@user.name.blank?` makes sense (and should return `true` if `nil` _or_ `&#8221;"`), `@user.name.empty?` does not.</p>
<p>Save `empty?` for things that can be empty: Arrays and Hashes, `[]` and `{}`. Certain methods should return arrays or hashes, empty or &#8220;full&#8221;, and if it&#8217;s returning `nil`, that&#8217;s a problem that should fail out when `empty?` is called on the object.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
