<?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: Thinking Linq</title>
	<atom:link href="http://lostechies.com/chrismissal/2012/06/28/thinking-linq/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/</link>
	<description>Thoughts while working and playing as a Software Developer</description>
	<lastBuildDate>Thu, 11 Apr 2013 16:53:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Guest</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-445</link>
		<dc:creator>Guest</dc:creator>
		<pubDate>Sun, 16 Sep 2012 03:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-445</guid>
		<description>2nd version is harder to read.</description>
		<content:encoded><![CDATA[<p>2nd version is harder to read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http://blog.andrei.rinea.ro</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-421</link>
		<dc:creator>http://blog.andrei.rinea.ro</dc:creator>
		<pubDate>Sat, 30 Jun 2012 14:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-421</guid>
		<description>Cute :)</description>
		<content:encoded><![CDATA[<p>Cute :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Rogers</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-420</link>
		<dc:creator>Will Rogers</dc:creator>
		<pubDate>Fri, 29 Jun 2012 16:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-420</guid>
		<description>Remove the ! and you&#039;ve got it.</description>
		<content:encoded><![CDATA[<p>Remove the ! and you&#8217;ve got it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre-Alain Vigeant</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-419</link>
		<dc:creator>Pierre-Alain Vigeant</dc:creator>
		<pubDate>Fri, 29 Jun 2012 13:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-419</guid>
		<description>There is a implementation problem with FirstOrDefault(lambda). Using a reflector tool, you can see that the Where(lambda) does a chekc on the type of collection and change its iteration method accordingly, whereas FirstOrDefault(lambda) use a simple foreach.


I don&#039;t know the rational behind that, because I think they should be implemented the same way.

So technically, while the result is the same, they are not doing the same process, and Where(lamba).FirstOrDefault() could be faster than FirstOrDefault(lambda) depending on the type of collection.</description>
		<content:encoded><![CDATA[<p>There is a implementation problem with FirstOrDefault(lambda). Using a reflector tool, you can see that the Where(lambda) does a chekc on the type of collection and change its iteration method accordingly, whereas FirstOrDefault(lambda) use a simple foreach.</p>
<p>I don&#8217;t know the rational behind that, because I think they should be implemented the same way.</p>
<p>So technically, while the result is the same, they are not doing the same process, and Where(lamba).FirstOrDefault() could be faster than FirstOrDefault(lambda) depending on the type of collection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver Hallam</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-418</link>
		<dc:creator>Oliver Hallam</dc:creator>
		<pubDate>Fri, 29 Jun 2012 10:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-418</guid>
		<description>Well yeah, function calls to different functions with the same arguments will look similar in IL.  What does this prove?

Surely you want to be looking at the difference in the implementations of Enumerable.Where and Enumerable.SkipWhile!  In fact though they are very similar, the TakeWhile enumerator just has an extra flag to ensure that it returns everything after the first element that didn&#039;t match.</description>
		<content:encoded><![CDATA[<p>Well yeah, function calls to different functions with the same arguments will look similar in IL.  What does this prove?</p>
<p>Surely you want to be looking at the difference in the implementations of Enumerable.Where and Enumerable.SkipWhile!  In fact though they are very similar, the TakeWhile enumerator just has an extra flag to ensure that it returns everything after the first element that didn&#8217;t match.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihasic</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-417</link>
		<dc:creator>Mihasic</dc:creator>
		<pubDate>Fri, 29 Jun 2012 08:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-417</guid>
		<description>AFAIK, it&#039;s not the compiler to solve that problem and those are different implementation.

First: create Iterator wrapper depending on type of enumerable, than browse for first item.
Second: just foreach loop with condition check (actual original method).</description>
		<content:encoded><![CDATA[<p>AFAIK, it&#8217;s not the compiler to solve that problem and those are different implementation.</p>
<p>First: create Iterator wrapper depending on type of enumerable, than browse for first item.<br />
Second: just foreach loop with condition check (actual original method).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-416</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 29 Jun 2012 08:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-416</guid>
		<description>FirstOrDefault can take an expression:

.FirstOrDefault(d =&gt; d.Exists)</description>
		<content:encoded><![CDATA[<p>FirstOrDefault can take an expression:</p>
<p>.FirstOrDefault(d =&gt; d.Exists)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #1135</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-415</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #1135</dc:creator>
		<pubDate>Fri, 29 Jun 2012 08:31:07 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-415</guid>
		<description>[...] Thinking Linq - Chris Missal shows there is often more than one way to re-write foreach style looping code with Linq, and that often the end result is the same in terms of the IL generated. [...]</description>
		<content:encoded><![CDATA[<p>[...] Thinking Linq &#8211; Chris Missal shows there is often more than one way to re-write foreach style looping code with Linq, and that often the end result is the same in terms of the IL generated. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel González García</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-414</link>
		<dc:creator>Daniel González García</dc:creator>
		<pubDate>Fri, 29 Jun 2012 06:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-414</guid>
		<description>I have to agree with some the folks that shy away from negative boolean logic.
The less code to parse and evaluate while reading it, the best.

And the second case does not click in my mind automatically, but needs second thoughts.

In my coding I favor the predicate-receiving functions of .First(), .Last(), .Single() (and their ...OrDefault() counterparts) over the .Where() filtering upfront.

But, at the end of the day, what matters is that LINQ rocks and has turned around my way of thinking about loops and sequence processing.

Cheers</description>
		<content:encoded><![CDATA[<p>I have to agree with some the folks that shy away from negative boolean logic.<br />
The less code to parse and evaluate while reading it, the best.</p>
<p>And the second case does not click in my mind automatically, but needs second thoughts.</p>
<p>In my coding I favor the predicate-receiving functions of .First(), .Last(), .Single() (and their &#8230;OrDefault() counterparts) over the .Where() filtering upfront.</p>
<p>But, at the end of the day, what matters is that LINQ rocks and has turned around my way of thinking about loops and sequence processing.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Missal</title>
		<link>http://lostechies.com/chrismissal/2012/06/28/thinking-linq/#comment-413</link>
		<dc:creator>Chris Missal</dc:creator>
		<pubDate>Thu, 28 Jun 2012 22:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/chrismissal/?p=251#comment-413</guid>
		<description>Lol, yes we do! :)</description>
		<content:encoded><![CDATA[<p>Lol, yes we do! :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
