<?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 Honest to a Segfault</title>
	<atom:link href="http://blog.cdleary.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cdleary.com</link>
	<description>__author__ = &#039;Chris Leary&#039;</description>
	<lastBuildDate>Mon, 06 Sep 2010 22:38:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on A prototypal binding trap by cdleary</title>
		<link>http://blog.cdleary.com/2010/09/a-prototypal-binding-trap/comment-page-1/#comment-3109</link>
		<dc:creator>cdleary</dc:creator>
		<pubDate>Mon, 06 Sep 2010 22:38:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=905#comment-3109</guid>
		<description>@Peter Hansen: Honestly, I&#039;m not concerned. This entry wasn&#039;t written with a newbie audience in mind -- readers already have to be familiar with the idea of method resolution order to understand why &lt;tt&gt;self._next_id&lt;/tt&gt; would resolve to &lt;tt&gt;Egg._next_id&lt;/tt&gt;. I think readers at that level of expertise will understand why I chose to use &lt;tt&gt;is&lt;/tt&gt;, especially if they read your helpful comments. :-)</description>
		<content:encoded><![CDATA[<p>@Peter Hansen: Honestly, I&#8217;m not concerned. This entry wasn&#8217;t written with a newbie audience in mind &#8212; readers already have to be familiar with the idea of method resolution order to understand why <tt>self._next_id</tt> would resolve to <tt>Egg._next_id</tt>. I think readers at that level of expertise will understand why I chose to use <tt>is</tt>, especially if they read your helpful comments. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A prototypal binding trap by Peter Hansen</title>
		<link>http://blog.cdleary.com/2010/09/a-prototypal-binding-trap/comment-page-1/#comment-3107</link>
		<dc:creator>Peter Hansen</dc:creator>
		<pubDate>Mon, 06 Sep 2010 19:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=905#comment-3107</guid>
		<description>@cdleary, I understand what you are trying to do, but it&#039;s if nothing else potentially confusing for newcomers.  Though it&#039;s obviously not going to happen in your simple test case, in a multithreaded application (for but one example of how this could occur), another thread might set Egg._next_id to 2 just before your assert statement... and your assert statement would not fail!</description>
		<content:encoded><![CDATA[<p>@cdleary, I understand what you are trying to do, but it&#8217;s if nothing else potentially confusing for newcomers.  Though it&#8217;s obviously not going to happen in your simple test case, in a multithreaded application (for but one example of how this could occur), another thread might set Egg._next_id to 2 just before your assert statement&#8230; and your assert statement would not fail!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A prototypal binding trap by cdleary</title>
		<link>http://blog.cdleary.com/2010/09/a-prototypal-binding-trap/comment-page-1/#comment-3106</link>
		<dc:creator>cdleary</dc:creator>
		<pubDate>Mon, 06 Sep 2010 18:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=905#comment-3106</guid>
		<description>@Peter Hansen: Thanks for the feedback. As you point out, you almost never want to use the &lt;tt&gt;is&lt;/tt&gt; operator in day-to-day programming; however, in this case, &lt;tt&gt;is&lt;/tt&gt; is doing exactly what we want -- we want to see if &lt;tt&gt;self._next_id&lt;/tt&gt; is &lt;em&gt;identical&lt;/em&gt; to &lt;tt&gt;Egg._next_id&lt;/tt&gt;, meaning that they resolve to the same object. Yes, the virtual machine keeps an integer object pool that could turn &lt;tt&gt;is&lt;/tt&gt; into &lt;tt&gt;==&lt;/tt&gt; behind our backs, but identity is the operation we really want here (semantically).</description>
		<content:encoded><![CDATA[<p>@Peter Hansen: Thanks for the feedback. As you point out, you almost never want to use the <tt>is</tt> operator in day-to-day programming; however, in this case, <tt>is</tt> is doing exactly what we want &#8212; we want to see if <tt>self._next_id</tt> is <em>identical</em> to <tt>Egg._next_id</tt>, meaning that they resolve to the same object. Yes, the virtual machine keeps an integer object pool that could turn <tt>is</tt> into <tt>==</tt> behind our backs, but identity is the operation we really want here (semantically).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A prototypal binding trap by Peter Hansen</title>
		<link>http://blog.cdleary.com/2010/09/a-prototypal-binding-trap/comment-page-1/#comment-3104</link>
		<dc:creator>Peter Hansen</dc:creator>
		<pubDate>Mon, 06 Sep 2010 15:27:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=905#comment-3104</guid>
		<description>It appears there&#039;s another trap, this time lurking in that assertion.  Using identity to compare integers can give unexpected results, since for integers in the range -5..256 (as of Python 2.6.5 anyway) the interpreter precreates and caches instances for each value (thus ensuring that if a and b are both 5, &quot;a is b&quot; will be True), but for integers outside that range it does not (meaning that for most integers, &quot;a is b&quot; will be False).  The moral is never use &quot;is&quot; to compare integers.</description>
		<content:encoded><![CDATA[<p>It appears there&#8217;s another trap, this time lurking in that assertion.  Using identity to compare integers can give unexpected results, since for integers in the range -5..256 (as of Python 2.6.5 anyway) the interpreter precreates and caches instances for each value (thus ensuring that if a and b are both 5, &#8220;a is b&#8221; will be True), but for integers outside that range it does not (meaning that for most integers, &#8220;a is b&#8221; will be False).  The moral is never use &#8220;is&#8221; to compare integers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A prototypal binding trap by Tweets that mention Honest to a Segfault» Blog Archive » A prototypal binding trap -- Topsy.com</title>
		<link>http://blog.cdleary.com/2010/09/a-prototypal-binding-trap/comment-page-1/#comment-3101</link>
		<dc:creator>Tweets that mention Honest to a Segfault» Blog Archive » A prototypal binding trap -- Topsy.com</dc:creator>
		<pubDate>Mon, 06 Sep 2010 00:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=905#comment-3101</guid>
		<description>[...] This post was mentioned on Twitter by Planet Python, Chris Leary. Chris Leary said: Posted: A prototypal binding trap http://bit.ly/aQOYbo [...]</description>
		<content:encoded><![CDATA[<div style="background-color: #fafad2;">
<p>[...] This post was mentioned on Twitter by Planet Python, Chris Leary. Chris Leary said: Posted: A prototypal binding trap <a href="http://bit.ly/aQOYbo" rel="nofollow">http://bit.ly/aQOYbo</a> [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on House rental, showers, and auctions by Dave</title>
		<link>http://blog.cdleary.com/2010/07/house-rental-showers-and-auctions/comment-page-1/#comment-2977</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sat, 07 Aug 2010 23:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=898#comment-2977</guid>
		<description>We actually had exactly the same config in Redmond.
No one wanted to pay more for any of the rooms, so we split it equally. But I got the master bedroom in exchange for acting as the house dad, ie. taking care of all the bills and collecting each month, making sure anything else was taken care of, etc.</description>
		<content:encoded><![CDATA[<p>We actually had exactly the same config in Redmond.<br />
No one wanted to pay more for any of the rooms, so we split it equally. But I got the master bedroom in exchange for acting as the house dad, ie. taking care of all the bills and collecting each month, making sure anything else was taken care of, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on House rental, showers, and auctions by walla walla</title>
		<link>http://blog.cdleary.com/2010/07/house-rental-showers-and-auctions/comment-page-1/#comment-2946</link>
		<dc:creator>walla walla</dc:creator>
		<pubDate>Thu, 05 Aug 2010 04:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=898#comment-2946</guid>
		<description>Assuming a year long lease how about each person gets a different room every 3 months. Keeps things interesting and motivates people to keep their room somewhat clean since they&#039;ll be subjected to someone else&#039;s after a quarter.</description>
		<content:encoded><![CDATA[<p>Assuming a year long lease how about each person gets a different room every 3 months. Keeps things interesting and motivates people to keep their room somewhat clean since they&#8217;ll be subjected to someone else&#8217;s after a quarter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coding style as a feature of language design by cdleary</title>
		<link>http://blog.cdleary.com/2010/07/coding-style-as-a-feature-of-language-design/comment-page-1/#comment-2939</link>
		<dc:creator>cdleary</dc:creator>
		<pubDate>Wed, 04 Aug 2010 09:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=886#comment-2939</guid>
		<description>@Gerv: Ah, nice catch -- you might have to continue to enforce style guidelines for comments. Human languages are a _lot_ harder to reformat/reflow. :-)

It seems like there are a few common heuristics for comment styles you might be able to factor out in a language-neutral and most-of-what-you-want kind of way. For example, on one of my projects we used \param instead of @param doxygen-style comments; also, it&#039;s probably not hard to convert simple things like &quot;stars on every line&quot; to &quot;stars on just the first and last lines&quot;.</description>
		<content:encoded><![CDATA[<p>@Gerv: Ah, nice catch &#8212; you might have to continue to enforce style guidelines for comments. Human languages are a _lot_ harder to reformat/reflow. :-)</p>
<p>It seems like there are a few common heuristics for comment styles you might be able to factor out in a language-neutral and most-of-what-you-want kind of way. For example, on one of my projects we used \param instead of @param doxygen-style comments; also, it&#8217;s probably not hard to convert simple things like &#8220;stars on every line&#8221; to &#8220;stars on just the first and last lines&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coding style as a feature of language design by Gerv</title>
		<link>http://blog.cdleary.com/2010/07/coding-style-as-a-feature-of-language-design/comment-page-1/#comment-2938</link>
		<dc:creator>Gerv</dc:creator>
		<pubDate>Wed, 04 Aug 2010 09:26:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=886#comment-2938</guid>
		<description>One thing you&#039;ve missed is comments. Some styles have comments like this:

/**********************************************************/
/* This is a comment in a nice box                        */
/**********************************************************/

If, say, your preference was for 75 character lines instead of 80, this wouldn&#039;t work well.

Gerv</description>
		<content:encoded><![CDATA[<p>One thing you&#8217;ve missed is comments. Some styles have comments like this:</p>
<p>/**********************************************************/<br />
/* This is a comment in a nice box                        */<br />
/**********************************************************/</p>
<p>If, say, your preference was for 75 character lines instead of 80, this wouldn&#8217;t work well.</p>
<p>Gerv</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Coding style as a feature of language design by Simon</title>
		<link>http://blog.cdleary.com/2010/07/coding-style-as-a-feature-of-language-design/comment-page-1/#comment-2897</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Sun, 01 Aug 2010 23:04:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cdleary.com/?p=886#comment-2897</guid>
		<description>@Chris - to some degree, the auto formatting could be made smarter if it can recognise certain &#039;idioms&#039; in the code, such as the chained &quot;return this&quot; methods of a builder (like StringBuilder, or Hibernate&#039;s Criteria queries). Supported, perhaps, by some form of metadata - not explicit formatting instructions, but something to tell it &quot;this class is a builder&quot;, so it can apply &quot;builder&quot; formatting rules?

It&#039;s not perfect though, since I can&#039;t see how *any* automated process could recognise that the fourth &quot;append&quot; call in my example above ought to be on the same line as the previous one, instead of on a new line like most builders. Though I suppose StringBuilder is an unusual case, a very generic builder, without a lot of semantics to the method names.</description>
		<content:encoded><![CDATA[<p>@Chris &#8211; to some degree, the auto formatting could be made smarter if it can recognise certain &#8216;idioms&#8217; in the code, such as the chained &#8220;return this&#8221; methods of a builder (like StringBuilder, or Hibernate&#8217;s Criteria queries). Supported, perhaps, by some form of metadata &#8211; not explicit formatting instructions, but something to tell it &#8220;this class is a builder&#8221;, so it can apply &#8220;builder&#8221; formatting rules?</p>
<p>It&#8217;s not perfect though, since I can&#8217;t see how *any* automated process could recognise that the fourth &#8220;append&#8221; call in my example above ought to be on the same line as the previous one, instead of on a new line like most builders. Though I suppose StringBuilder is an unusual case, a very generic builder, without a lot of semantics to the method names.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
