<?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: IQueryable Can Kill Your Dog, Steal Your Wife, Kill Your Will To Live, etc.</title>
	<atom:link href="http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/</link>
	<description>I make love to asp.net mvc, c#, vb, legos, ladies, etc.</description>
	<lastBuildDate>Wed, 28 Sep 2011 14:29:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jeswin</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2883</link>
		<dc:creator>Jeswin</dc:creator>
		<pubDate>Thu, 01 Sep 2011 14:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2883</guid>
		<description>@Evan

Hey I didn&#039;t notice the date on it; I came in via reddit. I should have worded the reply differently, but it was those headings. :)
Lessons for me. And thanks for publishing. 

One could argue that exposing IQueryable lets better programmers write concise code since you can now compose your logic. 
a) some-query-getting-customers.Select(a -&gt; a.Id) //If you just wanted the IDs, quite common
b) query.Where(other-conditions) //If we already have a query and you just wanted to filter some more.

Or consider Sorting and Paging. The post you linked to (from Justin) introduced new patterns for functionality that is already built-in. And never mind that those new classes (Sortable, Pageable etc) wrapped the IQueryable within it. Sometimes people do this because they fear it just wouldn&#039;t be &quot;N-Tier enough&quot; if the Queryable got out of the middle tier. It doesn&#039;t really matter though.

I don&#039;t care about code quality, standards or best practices. I am happy if it works, happier if it is also concise.

Thanks.</description>
		<content:encoded><![CDATA[<p>@Evan</p>
<p>Hey I didn&#8217;t notice the date on it; I came in via reddit. I should have worded the reply differently, but it was those headings. <img src='http://www.weirdlover.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Lessons for me. And thanks for publishing. </p>
<p>One could argue that exposing IQueryable lets better programmers write concise code since you can now compose your logic.<br />
a) some-query-getting-customers.Select(a -&gt; a.Id) //If you just wanted the IDs, quite common<br />
b) query.Where(other-conditions) //If we already have a query and you just wanted to filter some more.</p>
<p>Or consider Sorting and Paging. The post you linked to (from Justin) introduced new patterns for functionality that is already built-in. And never mind that those new classes (Sortable, Pageable etc) wrapped the IQueryable within it. Sometimes people do this because they fear it just wouldn&#8217;t be &#8220;N-Tier enough&#8221; if the Queryable got out of the middle tier. It doesn&#8217;t really matter though.</p>
<p>I don&#8217;t care about code quality, standards or best practices. I am happy if it works, happier if it is also concise.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2882</link>
		<dc:creator>Evan</dc:creator>
		<pubDate>Thu, 01 Sep 2011 12:11:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2882</guid>
		<description>@Jeswin, 

I&#039;m not solving an imaginary problem here. Check out the Reddit conversation from today. 

It&#039;s very simple. One year after writing this post, folks *still* don&#039;t realize that a call like this:

var q = context.Users.AsQueryable();
var e = q.AsEnumerable();
e.First();

will select and return ALL of the user records in your database. 

That&#039;s not a &quot;contrived&quot; rule. That&#039;s a serious problem that needs to be documented and addressed.

Also, I appreciate your three rules (the first of which is to avoid rules), but I find them to be a bit presumptuous. You don&#039;t have me as pegged as well as you think you do.

Cheers,
E</description>
		<content:encoded><![CDATA[<p>@Jeswin, </p>
<p>I&#8217;m not solving an imaginary problem here. Check out the Reddit conversation from today. </p>
<p>It&#8217;s very simple. One year after writing this post, folks *still* don&#8217;t realize that a call like this:</p>
<p>var q = context.Users.AsQueryable();<br />
var e = q.AsEnumerable();<br />
e.First();</p>
<p>will select and return ALL of the user records in your database. </p>
<p>That&#8217;s not a &#8220;contrived&#8221; rule. That&#8217;s a serious problem that needs to be documented and addressed.</p>
<p>Also, I appreciate your three rules (the first of which is to avoid rules), but I find them to be a bit presumptuous. You don&#8217;t have me as pegged as well as you think you do.</p>
<p>Cheers,<br />
E</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeswin</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2881</link>
		<dc:creator>Jeswin</dc:creator>
		<pubDate>Thu, 01 Sep 2011 03:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2881</guid>
		<description>The problem with Justin Etheridge&#039;s article is that he assumes developers are dumb and won&#039;t know what is right from wrong. Then, the project has a bigger problem than exposing IQueryable.

Once upon a time, I used to believe in these patterns and ideals. I used to make similar rules for myself and others (Don&#039;t do this, don&#039;t return that, this should always do that etc). I wisened up after that. For all the pain, my rules had achieved very, very little. 

When I look back, I laugh at all the juvenile bullshit I spewed out.

Here is my advice:
1. Don&#039;t worry about rules which solve an imaginary problem.

2. Learn some other programming languages: Such as Python, Ruby or LISP/Clojure. Most people who obsess over trivial details know only Java or C#, and rarely stray out of their Windows IDEs.

3. Use Linux for a bit, even if you don&#039;t use it for your job. Read up on computing history, the culture, the Jargon File, the AI Koans, ESR&#039;s books, SICP; there&#039;s a whole lot of good stuff out there.

Nothing will happen to your dog. Or your wife.</description>
		<content:encoded><![CDATA[<p>The problem with Justin Etheridge&#8217;s article is that he assumes developers are dumb and won&#8217;t know what is right from wrong. Then, the project has a bigger problem than exposing IQueryable.</p>
<p>Once upon a time, I used to believe in these patterns and ideals. I used to make similar rules for myself and others (Don&#8217;t do this, don&#8217;t return that, this should always do that etc). I wisened up after that. For all the pain, my rules had achieved very, very little. </p>
<p>When I look back, I laugh at all the juvenile bullshit I spewed out.</p>
<p>Here is my advice:<br />
1. Don&#8217;t worry about rules which solve an imaginary problem.</p>
<p>2. Learn some other programming languages: Such as Python, Ruby or LISP/Clojure. Most people who obsess over trivial details know only Java or C#, and rarely stray out of their Windows IDEs.</p>
<p>3. Use Linux for a bit, even if you don&#8217;t use it for your job. Read up on computing history, the culture, the Jargon File, the AI Koans, ESR&#8217;s books, SICP; there&#8217;s a whole lot of good stuff out there.</p>
<p>Nothing will happen to your dog. Or your wife.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darth Continent</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2879</link>
		<dc:creator>Darth Continent</dc:creator>
		<pubDate>Wed, 31 Aug 2011 18:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2879</guid>
		<description>Great article, I&#039;m going to go take a look at why we&#039;re using IQueryable in some possibly horrendous ways in an app I&#039;m working on and see if I can stop any further insanity!</description>
		<content:encoded><![CDATA[<p>Great article, I&#8217;m going to go take a look at why we&#8217;re using IQueryable in some possibly horrendous ways in an app I&#8217;m working on and see if I can stop any further insanity!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Kameron</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2656</link>
		<dc:creator>Lee Kameron</dc:creator>
		<pubDate>Wed, 18 May 2011 20:35:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2656</guid>
		<description>Interesting article, you made me laugh(good thing).. and I like the blog layout : )</description>
		<content:encoded><![CDATA[<p>Interesting article, you made me laugh(good thing).. and I like the blog layout : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt kocaj</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2624</link>
		<dc:creator>matt kocaj</dc:creator>
		<pubDate>Wed, 23 Mar 2011 04:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2624</guid>
		<description>Keep your &quot;messy&quot; type and headings. If ppl don&#039;t like it- tough. I didn&#039;t think it made the content any harder to read.

Gosh! Ppl telling you how to &quot;fix&quot; your blog.

I love the humorous inserts and out-of-context analogies. It&#039;s great!</description>
		<content:encoded><![CDATA[<p>Keep your &#8220;messy&#8221; type and headings. If ppl don&#8217;t like it- tough. I didn&#8217;t think it made the content any harder to read.</p>
<p>Gosh! Ppl telling you how to &#8220;fix&#8221; your blog.</p>
<p>I love the humorous inserts and out-of-context analogies. It&#8217;s great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Halford</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2601</link>
		<dc:creator>Martin Halford</dc:creator>
		<pubDate>Wed, 09 Mar 2011 15:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2601</guid>
		<description>Great article. Thought provoking... Hadn&#039;t realised there was so much concern over IQueryable!</description>
		<content:encoded><![CDATA[<p>Great article. Thought provoking&#8230; Hadn&#8217;t realised there was so much concern over IQueryable!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlexanderMP</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2561</link>
		<dc:creator>AlexanderMP</dc:creator>
		<pubDate>Tue, 08 Feb 2011 21:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2561</guid>
		<description>Only now, after I&#039;ve recommended this article, for learning purposes, to many many people, I&#039;ve come to understand its true value. Great work! Too bad it&#039;s so hard to google it each time when I don&#039;t remember exactly what to write.
It also helped me, to better understand, and &quot;feel&quot;, what IQueryable is for. &quot;Drop it like it&#039;s hot&quot; may be the best advice. As soon as I&#039;m done with the query itself, ToList() with it :)</description>
		<content:encoded><![CDATA[<p>Only now, after I&#8217;ve recommended this article, for learning purposes, to many many people, I&#8217;ve come to understand its true value. Great work! Too bad it&#8217;s so hard to google it each time when I don&#8217;t remember exactly what to write.<br />
It also helped me, to better understand, and &#8220;feel&#8221;, what IQueryable is for. &#8220;Drop it like it&#8217;s hot&#8221; may be the best advice. As soon as I&#8217;m done with the query itself, ToList() with it <img src='http://www.weirdlover.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manas</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2542</link>
		<dc:creator>Manas</dc:creator>
		<pubDate>Sun, 02 Jan 2011 17:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2542</guid>
		<description>Awesome , your Article Heading made me to read .This is how blog post should be written , really Nice.

Thanks Evan.</description>
		<content:encoded><![CDATA[<p>Awesome , your Article Heading made me to read .This is how blog post should be written , really Nice.</p>
<p>Thanks Evan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.weirdlover.com/2010/05/11/iqueryable-can-kill-your-dog-steal-your-wife-kill-your-will-to-live-etc/comment-page-1/#comment-2530</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 01 Dec 2010 03:50:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.weirdlover.com/?p=75#comment-2530</guid>
		<description>Me! Me!

The structure seems a bit intimidating, but when you break it you realise there isn&#039;t much more than another layer beyond the familiar Repository.

I like the concept and see the extensibility, but again you&#039;re stuck only with the methods that you pipes expose, which as you state gives you the ability to control what&#039;s exposed.

That&#039;s good when you don&#039;t need to juggle with the database too much. But what happens when you need to execute some serious sorting, filtering, etc? You&#039;d end up writing way too many methods, don&#039;t you think? Imagine the long run maintenance... methods.. methods.. methods.. Had you exposed the results directly from the repo you&#039;d have it all ready to be manipulated by the consumer.

I understand that the consumer would be required to know how to handle the IQueryable.

I guess either way there&#039;s no magic one-size-fit-all answer.

Bottom line - if you know the consumer (a colleague who uses your library, or even yourself) then exposing IQueryable is just fine (you can torture those who misuse it!). If you&#039;re selling the library to third parties (no torture here) then you may want to consider a less &quot;open&quot; approach.

My 2c.. :-)
D.</description>
		<content:encoded><![CDATA[<p>Me! Me!</p>
<p>The structure seems a bit intimidating, but when you break it you realise there isn&#8217;t much more than another layer beyond the familiar Repository.</p>
<p>I like the concept and see the extensibility, but again you&#8217;re stuck only with the methods that you pipes expose, which as you state gives you the ability to control what&#8217;s exposed.</p>
<p>That&#8217;s good when you don&#8217;t need to juggle with the database too much. But what happens when you need to execute some serious sorting, filtering, etc? You&#8217;d end up writing way too many methods, don&#8217;t you think? Imagine the long run maintenance&#8230; methods.. methods.. methods.. Had you exposed the results directly from the repo you&#8217;d have it all ready to be manipulated by the consumer.</p>
<p>I understand that the consumer would be required to know how to handle the IQueryable.</p>
<p>I guess either way there&#8217;s no magic one-size-fit-all answer.</p>
<p>Bottom line &#8211; if you know the consumer (a colleague who uses your library, or even yourself) then exposing IQueryable is just fine (you can torture those who misuse it!). If you&#8217;re selling the library to third parties (no torture here) then you may want to consider a less &#8220;open&#8221; approach.</p>
<p>My 2c.. <img src='http://www.weirdlover.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
D.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

