<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Familiar idioms in Perl, Python, JavaScript, and C#</title>
	<atom:link href="http://blog.jonudell.net/2009/09/16/familiar-idioms/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/</link>
	<description>Strategies for Internet citizens</description>
	<lastBuildDate>Sat, 11 Feb 2012 19:45:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: asp.net, c#,javascript</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-186479</link>
		<dc:creator><![CDATA[asp.net, c#,javascript]]></dc:creator>
		<pubDate>Thu, 29 Sep 2011 20:18:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-186479</guid>
		<description><![CDATA[&lt;strong&gt;asp.net, c#,javascript...&lt;/strong&gt;

[...]Familiar idioms in Perl, Python, JavaScript, and C# &#171; Jon Udell[...]...]]></description>
		<content:encoded><![CDATA[<p><strong>asp.net, c#,javascript&#8230;</strong></p>
<p>[...]Familiar idioms in Perl, Python, JavaScript, and C# &laquo; Jon Udell[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: More Python and C# idioms: Finding the difference between two list &#171; Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130421</link>
		<dc:creator><![CDATA[More Python and C# idioms: Finding the difference between two list &#171; Jon Udell]]></dc:creator>
		<pubDate>Thu, 22 Oct 2009 23:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130421</guid>
		<description><![CDATA[[...] by Jon Udell under Uncategorized Leave a Comment&#160;   Recently I&#8217;ve posted two examples[1, 2] of Python idioms alongside corresponding C# idioms. It always intrigues me to look at the same [...]]]></description>
		<content:encoded><![CDATA[<p>[...] by Jon Udell under Uncategorized Leave a Comment&nbsp;   Recently I&#8217;ve posted two examples[1, 2] of Python idioms alongside corresponding C# idioms. It always intrigues me to look at the same [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Querying mobile data objects with LINQ &#171; Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130265</link>
		<dc:creator><![CDATA[Querying mobile data objects with LINQ &#171; Jon Udell]]></dc:creator>
		<pubDate>Tue, 29 Sep 2009 13:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130265</guid>
		<description><![CDATA[[...] meaning to try out LINQtoCSV, the .NET equivalent of my old friend, Python&#8217;s csv module. As happens lately, I was struck by the convergence of the languages. Here&#8217;s a side-by-side comparison of Python [...]]]></description>
		<content:encoded><![CDATA[<p>[...] meaning to try out LINQtoCSV, the .NET equivalent of my old friend, Python&#8217;s csv module. As happens lately, I was struck by the convergence of the languages. Here&#8217;s a side-by-side comparison of Python [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Allen</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130247</link>
		<dc:creator><![CDATA[Joshua Allen]]></dc:creator>
		<pubDate>Mon, 28 Sep 2009 03:35:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130247</guid>
		<description><![CDATA[:-)  Nice post!  I love how the best parts of each language have been coming over to the others.]]></description>
		<content:encoded><![CDATA[<p>:-)  Nice post!  I love how the best parts of each language have been coming over to the others.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130237</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Fri, 25 Sep 2009 14:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130237</guid>
		<description><![CDATA[I was curious what the underlying extension method syntax looks like. Tried and of course failed to write something that would work. Then cheated and used Reflector to look:

List&lt;Dictionary&gt; l = es.events.Where(delegate (EventStore.evt evt) { return (evt.categories != null); }).SelectMany(delegate (EventStore.evt evt) { return evt.categories.Split(new char[] { &#039;,&#039; }); }, delegate (EventStore.evt evt, string tag) { return new { evt = evt, tag = tag }; }).GroupBy(delegate(h__TransparentIdentifier0  h__TransparentIdentifier0){
return h__TransparentIdentifier0.tag;}, delegate (f__AnonymousType0 h__TransparentIdentifier0) 
{return h__TransparentIdentifier0.tag;}).      OrderByDescending&lt;IGrouping, int&gt;(delegate (IGrouping occurrences) { return occurrences.Count();    }).Select&lt;IGrouping, Dictionary&gt;(delegate (IGrouping occurrences) {        Dictionary g__initLocal1 = new Dictionary();      g__initLocal1.Add(occurrences.Key, occurrences.Count());
return g__initLocal1;    }).ToList&lt;Dictionary&gt;();

Whoa.]]></description>
		<content:encoded><![CDATA[<p>I was curious what the underlying extension method syntax looks like. Tried and of course failed to write something that would work. Then cheated and used Reflector to look:</p>
<p>List&lt;Dictionary&gt; l = es.events.Where(delegate (EventStore.evt evt) { return (evt.categories != null); }).SelectMany(delegate (EventStore.evt evt) { return evt.categories.Split(new char[] { &#8216;,&#8217; }); }, delegate (EventStore.evt evt, string tag) { return new { evt = evt, tag = tag }; }).GroupBy(delegate(h__TransparentIdentifier0  h__TransparentIdentifier0){<br />
return h__TransparentIdentifier0.tag;}, delegate (f__AnonymousType0 h__TransparentIdentifier0)<br />
{return h__TransparentIdentifier0.tag;}).      OrderByDescending&lt;IGrouping, int&gt;(delegate (IGrouping occurrences) { return occurrences.Count();    }).Select&lt;IGrouping, Dictionary&gt;(delegate (IGrouping occurrences) {        Dictionary g__initLocal1 = new Dictionary();      g__initLocal1.Add(occurrences.Key, occurrences.Count());<br />
return g__initLocal1;    }).ToList&lt;Dictionary&gt;();</p>
<p>Whoa.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130236</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Fri, 25 Sep 2009 12:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130236</guid>
		<description><![CDATA[Oh. Duh. Of course. Nice! Thanks!]]></description>
		<content:encoded><![CDATA[<p>Oh. Duh. Of course. Nice! Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris hollander</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130235</link>
		<dc:creator><![CDATA[chris hollander]]></dc:creator>
		<pubDate>Thu, 24 Sep 2009 20:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130235</guid>
		<description><![CDATA[if you wanted to be able to just .ToList() the query, you could have the query select out the dictionary items that you want- just change the end of it to:

select new Dictionary() {{  occurances.Key,  occurances.Count() }};]]></description>
		<content:encoded><![CDATA[<p>if you wanted to be able to just .ToList() the query, you could have the query select out the dictionary items that you want- just change the end of it to:</p>
<p>select new Dictionary() {{  occurances.Key,  occurances.Count() }};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pbannister</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130225</link>
		<dc:creator><![CDATA[pbannister]]></dc:creator>
		<pubDate>Tue, 22 Sep 2009 22:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130225</guid>
		<description><![CDATA[Old habits also explain why almost all examples written in Javascript - up until very recently - are crap. Most folk wrote VisualBasic-in-Javascript or Java-in-Javascript. Really horrible stuff.

The mutable nature of Javascript reminds me a bit of Lisp and Prototype. Used Lisp a fair amount in school. Prototype was more dynamic sort of object-oriented language built around instance prototypes rather than static classes, and presented in a paper around 1990. (Good luck finding the paper, as &quot;Prototype&quot; is not a good search term.)]]></description>
		<content:encoded><![CDATA[<p>Old habits also explain why almost all examples written in Javascript &#8211; up until very recently &#8211; are crap. Most folk wrote VisualBasic-in-Javascript or Java-in-Javascript. Really horrible stuff.</p>
<p>The mutable nature of Javascript reminds me a bit of Lisp and Prototype. Used Lisp a fair amount in school. Prototype was more dynamic sort of object-oriented language built around instance prototypes rather than static classes, and presented in a paper around 1990. (Good luck finding the paper, as &#8220;Prototype&#8221; is not a good search term.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130224</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Tue, 22 Sep 2009 20:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130224</guid>
		<description><![CDATA[&gt; http://bannister.us/examples/...

&gt; I am a bit more fond of isolation through
&gt; use of namespaces, and prefer to add a bit
&gt; more room for reuse. Make what you want of
&gt;  the difference.

Your JS example and Chris Hollander&#039;s C# example further sharpen my point in comment 2: mapping old habits onto new languages tends to obscure what makes those new languages special.]]></description>
		<content:encoded><![CDATA[<p>&gt; <a href="http://bannister.us/examples/.." rel="nofollow">http://bannister.us/examples/..</a>.</p>
<p>&gt; I am a bit more fond of isolation through<br />
&gt; use of namespaces, and prefer to add a bit<br />
&gt; more room for reuse. Make what you want of<br />
&gt;  the difference.</p>
<p>Your JS example and Chris Hollander&#8217;s C# example further sharpen my point in comment 2: mapping old habits onto new languages tends to obscure what makes those new languages special.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130223</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Tue, 22 Sep 2009 20:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130223</guid>
		<description><![CDATA[Chris: Thanks! For the query itself, I only had to add a null check on categories. 

In order to actually return a List&lt;Dictionary&lt;string,int&gt;&gt;, however, I couldn&#039;t just ToList() the query, but instead had to enumerate it and build the return value.

&lt;pre&gt;
var tagquery =
  from evt in es.events
    where evt.categories != null
    from tag in evt.categories.Split(&#039;,&#039;)
    group tag by tag into occurrences
    orderby occurrences.Count() descending
    select new
      {
      tag = occurrences.Key,
      count = occurrences.Count()
      };

var tagcloud = new List&lt;Dictionary&gt;();
foreach (var result in tagquery)
  {
  var dict = new Dictionary() 
     { { result.tag, result.count } };
  tagcloud.Add(dict);
  }
return tagcloud;
&lt;/pre&gt;

I have used this approach sparingly because I&#039;m not good at visualizing what goes on inside a LINQ query. With my more old-fashioned style I can step through everything in the debugger and understand things better.]]></description>
		<content:encoded><![CDATA[<p>Chris: Thanks! For the query itself, I only had to add a null check on categories. </p>
<p>In order to actually return a List&lt;Dictionary&lt;string,int&gt;&gt;, however, I couldn&#8217;t just ToList() the query, but instead had to enumerate it and build the return value.</p>
<pre>
var tagquery =
  from evt in es.events
    where evt.categories != null
    from tag in evt.categories.Split(',')
    group tag by tag into occurrences
    orderby occurrences.Count() descending
    select new
      {
      tag = occurrences.Key,
      count = occurrences.Count()
      };

var tagcloud = new List&lt;Dictionary&gt;();
foreach (var result in tagquery)
  {
  var dict = new Dictionary()
     { { result.tag, result.count } };
  tagcloud.Add(dict);
  }
return tagcloud;
</pre>
<p>I have used this approach sparingly because I&#8217;m not good at visualizing what goes on inside a LINQ query. With my more old-fashioned style I can step through everything in the debugger and understand things better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris hollander</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130222</link>
		<dc:creator><![CDATA[chris hollander]]></dc:creator>
		<pubDate>Tue, 22 Sep 2009 17:28:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130222</guid>
		<description><![CDATA[decided not to wait. ;)

var sortedTagDict = 
from evt in esevents
from tag in evt.categories.Split(&#039;,&#039;)
group tag by tag into occurances
orderby occurances.Count() descending
select new { 
	tag = occurances.Key, 
	count = occurances.Count() };]]></description>
		<content:encoded><![CDATA[<p>decided not to wait. ;)</p>
<p>var sortedTagDict =<br />
from evt in esevents<br />
from tag in evt.categories.Split(&#8216;,&#8217;)<br />
group tag by tag into occurances<br />
orderby occurances.Count() descending<br />
select new {<br />
	tag = occurances.Key,<br />
	count = occurances.Count() };</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris hollander</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130221</link>
		<dc:creator><![CDATA[chris hollander]]></dc:creator>
		<pubDate>Tue, 22 Sep 2009 16:31:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130221</guid>
		<description><![CDATA[would love to see a LINQ implementation...]]></description>
		<content:encoded><![CDATA[<p>would love to see a LINQ implementation&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Preston L. Bannister</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130210</link>
		<dc:creator><![CDATA[Preston L. Bannister]]></dc:creator>
		<pubDate>Sun, 20 Sep 2009 22:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130210</guid>
		<description><![CDATA[Posted my equivalent exercise to...
http://bannister.us/examples/udell-2009-09-16/

I am a bit more fond of isolation through use of namespaces, and prefer to add a bit more room for reuse. Make what you want of the difference.]]></description>
		<content:encoded><![CDATA[<p>Posted my equivalent exercise to&#8230;<br />
<a href="http://bannister.us/examples/udell-2009-09-16/" rel="nofollow">http://bannister.us/examples/udell-2009-09-16/</a></p>
<p>I am a bit more fond of isolation through use of namespaces, and prefer to add a bit more room for reuse. Make what you want of the difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David W</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130205</link>
		<dc:creator><![CDATA[David W]]></dc:creator>
		<pubDate>Sun, 20 Sep 2009 01:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130205</guid>
		<description><![CDATA[Hi Jon,

I&#039;ve thought about it for a few days now, and the answer doesn&#039;t seem simple. On the one hand, there is the well known correlation between bug count and LOC, whereas on the other, the newer, more compact version of the code in question requires a greater understanding of Javascript on the part of the maintainer in order to modify the code.

I&#039;m leaning towards &quot;more maintainable&quot;, due to potentially reduced bug count, and therefore the less maintenance likely required, but it&#039;s a very good and slightly troubling question. :)]]></description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>I&#8217;ve thought about it for a few days now, and the answer doesn&#8217;t seem simple. On the one hand, there is the well known correlation between bug count and LOC, whereas on the other, the newer, more compact version of the code in question requires a greater understanding of Javascript on the part of the maintainer in order to modify the code.</p>
<p>I&#8217;m leaning towards &#8220;more maintainable&#8221;, due to potentially reduced bug count, and therefore the less maintenance likely required, but it&#8217;s a very good and slightly troubling question. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Udell</title>
		<link>http://blog.jonudell.net/2009/09/16/familiar-idioms/#comment-130183</link>
		<dc:creator><![CDATA[Jon Udell]]></dc:creator>
		<pubDate>Thu, 17 Sep 2009 14:17:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jonudell.net/?p=1883#comment-130183</guid>
		<description><![CDATA[&gt; This resulted in missing the benefits of 
&gt; closures in many cases, whereupon later
&gt; rewriting some code, reduced it from 200 
&gt; lines to 30 (really).

Curious: Do you think the 30 lines is as (or more) readable/maintainable by others? By your future self even?]]></description>
		<content:encoded><![CDATA[<p>&gt; This resulted in missing the benefits of<br />
&gt; closures in many cases, whereupon later<br />
&gt; rewriting some code, reduced it from 200<br />
&gt; lines to 30 (really).</p>
<p>Curious: Do you think the 30 lines is as (or more) readable/maintainable by others? By your future self even?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

