<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx</link><description>I&amp;#39;m trying something slightly different this time. Joe (the author) has reacted to specific points of my review, and I think it makes sense to show those reactions. I&amp;#39;d originally hoped to present them so that you could toggle them on or off,</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648812</link><pubDate>Wed, 24 Sep 2008 20:57:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648812</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;@Joe,&lt;/p&gt;
&lt;p&gt;In that particular case, that&amp;#39;s what autosave is for :) There are two problems with the approach you are suggesting. First, hiding problems that seem innocuous can lead to further data corruption. For example, what if one of those instances in your enumeration, actually contained data that needed to be processed, but you ignored it because it was a different type? Now you have lost data, and no one even knows about it! Throwing an exception might also lose data (if the data being processed is not already stored persistently), but at least the user knows that a problem occurred and can take steps to correct it, outside of the context of your application if necessary.&lt;/p&gt;
&lt;p&gt;Second, by hiding the problem where it occurred, you make it harder to determine whether there is actually a problem, and harder to track down the problem once someone figures out that a problem is actually occurring. Your assertion that once your code is in production &amp;quot;you missed your chance to fail fast&amp;quot; is incorrect. The point of failing fast is to make sure that the symptom occurs as close to the cause as possible, so that you can backtrack from the symptom to the cause as quickly and easily as possible. This is true whether the problem is occurring in development or in production. In fact it is even more important to fail fast in production, since getting the system back in proper working order as soon as possible is essential to customer relations (even if your customer is your boss). Having an application crash (with a friendly error message) may not be ideal, but if it helps correct the problem and get the system back in working order more quickly, it is worth it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648812" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648802</link><pubDate>Wed, 24 Sep 2008 19:00:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648802</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;I&amp;#39;m with David on this: throwing an exception is the right way to go. Throwing an exception is likely to make the user see an error message (hopefully a nice one, etc). That&amp;#39;s not great, but it&amp;#39;s *much* better than the system just proceeding as if nothing had gone wrong.&lt;/p&gt;
&lt;p&gt;Note that throwing an exception doesn&amp;#39;t have to (and shouldn&amp;#39;t) mean shutting down the process without any chance to save things. However, I would far rather that than it *silently* losing data.&lt;/p&gt;
&lt;p&gt;When something is seriously wrong (as it would have to be in this case), the whole operation should be aborted as quickly as possible rather than silently pretending to succeed. Using OfType here could hide the bug for months, leading to customer support calls which would quite possibly have no indications of problems in the logs, and be very hard to track down. An exception is brutal, but when the system is so badly hosed that you&amp;#39;ve got unexpected and incorrect data in it, proceeding as if nothing had happened is simply wrong IMO.&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648802" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648801</link><pubDate>Wed, 24 Sep 2008 18:49:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648801</guid><dc:creator>Joe Rattz</dc:creator><description>&lt;p&gt;@David Nelson:&lt;/p&gt;
&lt;p&gt;Well if you used Cast in development and testing, and the error wasn&amp;#39;t caught by the developer or QA, you missed your chance to fail fast. &amp;nbsp;The next question becomes, what do you want the user experience to be? &amp;nbsp;Sometimes users enter unanticipated input that programmers just don&amp;#39;t think to catch and bad things happen.&lt;/p&gt;
&lt;p&gt;So if you have been editing in Visual Studio for a couple hours without saving (yeah, I know, who would do that?) and some error managed to slip through QA at Microsoft, you would prefer Visual Studio to just throw a fatal exception, shutdown the process, and lose all your work rather than just ignoring the problem?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648801" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648796</link><pubDate>Wed, 24 Sep 2008 17:26:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648796</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;&amp;quot;[Joe] My preference would be to use Cast in development and debug built code...but to use OfType in production code.&amp;quot;&lt;/p&gt;
&lt;p&gt;Hiding errors in production is just as bad an idea as hiding them in development. If you expect all of the members of an enumeration to be of a particular type, and one or more members are actually of another type, that means reality is not lining up with your expectations, and there is probably a deeper bug somewhere. Hiding the problem doesn&amp;#39;t make it go away, it just makes it harder to find when you need to find it. Fail fast!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648796" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648668</link><pubDate>Tue, 23 Sep 2008 14:43:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648668</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Looks like Google Reader only shows &amp;quot;Overture&amp;quot; too. I&amp;#39;ve really no idea why. I&amp;#39;ll get rid of all trace of the JavaScript etc and see if that helps.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648668" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648641</link><pubDate>Tue, 23 Sep 2008 09:27:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648641</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@Mike: Not a lot I can do about that, I&amp;#39;m afraid. As we&amp;#39;ve seen with the comments debacle, I can&amp;#39;t control a lot with this blog :(&lt;/p&gt;
&lt;p&gt;@Paul: Glad you enjoyed it. Looks like the &amp;quot;interleaved&amp;quot; comments aren&amp;#39;t too much of a problem. I don&amp;#39;t expect all authors will give full feedback, of course - but when they do (and if they don&amp;#39;t mind), I&amp;#39;ll post it in a similar way.&lt;/p&gt;
&lt;p&gt;Next stop will almost certainly be &amp;quot;Programming C# 3.0&amp;quot; but I&amp;#39;ll try to do &amp;quot;CLR via C#&amp;quot; after that.&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648641" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648637</link><pubDate>Tue, 23 Sep 2008 09:11:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648637</guid><dc:creator>Paul Batum</dc:creator><description>&lt;p&gt;Really enjoyed that review Jon! I would certainly like to read more reviews written in that style.&lt;/p&gt;
&lt;p&gt;I would also like to +1 Peter&amp;#39;s comment about reviewing CLR via C#, even though the book is now quite old.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648637" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648636</link><pubDate>Tue, 23 Sep 2008 09:10:28 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648636</guid><dc:creator>Mike Street</dc:creator><description>&lt;p&gt;The only thing that displays in MS Outlook 7007 RSS Feed reader is &amp;quot;Overture&amp;quot;. You have to takr the option to see the full article in a browser to read further&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648636" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648578</link><pubDate>Mon, 22 Sep 2008 22:34:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648578</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Okay, I&amp;#39;m giving up for the night. I&amp;#39;ve got close to getting it working by putting the script in an external file - but then I need to hook up the click event as well. I&amp;#39;ll have another go tomorrow. The roundtrip time for testing changes is just too painful at the moment.&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648578" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648575</link><pubDate>Mon, 22 Sep 2008 22:00:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648575</guid><dc:creator>peted</dc:creator><description>&lt;p&gt;Ironically, I see that in my comment, the character entities have themselves not been quoted and so show up as the actual characters, not the XML entity code.&lt;/p&gt;
&lt;p&gt;So where I wrote &amp;quot;there should have been a &amp;lt; where you have an angle-bracket&amp;quot;, it should have actually said &amp;quot;there should have been a &amp;amp;lt; where you have an angle-bracket&amp;quot;. &amp;nbsp;There was a similar alteration for the double-quotes, which I posted as &amp;amp;quot; but which actually got displayed as &amp;quot;.&lt;/p&gt;
&lt;p&gt;(I made an attempt to use an explicit character entity for the ampersand in the previous paragraph, but it remains to be seen whether that gets translated somehow too :) ).&lt;/p&gt;
&lt;p&gt;As far as work-around goes until you can get the comment-hiding working right, you might consider placing all of the comments at the end of the post, with links to them via page-relative anchors. &amp;nbsp;A little less elegant than in-line, but not terribly so and perhaps closer to your original intent than just having them shown all the time.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648575" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648571</link><pubDate>Mon, 22 Sep 2008 21:53:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648571</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;The show/hide comments link also doesn&amp;#39;t work on FF3. IE7 throws a javascript error and most of the page (everything after &amp;quot;Overture&amp;quot;) doesn&amp;#39;t render.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648571" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648568</link><pubDate>Mon, 22 Sep 2008 21:40:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648568</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@peted: Yup, looks like it was stripping stuff. (Previously it was stripping input tags.) Oh, and it also changes double quotes into ampersand quot semi-colon. Grr.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t help that of course the HTML I&amp;#39;m uploading works fine locally. It also doesn&amp;#39;t help that I&amp;#39;ve currently only got access to mobile broadband with a poor signal, and I&amp;#39;ve had guests round this evening... Oh, and whenever I post to the blog it spews out a cached copy for a while. Basically it&amp;#39;s a pain in the neck fixing problems like this :(&lt;/p&gt;
&lt;p&gt;@Peter: Originally Joe had written &amp;quot;[Joe]&amp;quot; at the start of each of his comments. Keeping that in might help the RSS feed to be more useful... I&amp;#39;ll reinstate it now. And yes, I&amp;#39;ll get round to CLR via C# some time - I have it now. I didn&amp;#39;t realise it&amp;#39;s just the second edition of another title; I feel less guilty about not having read it before (as I&amp;#39;d read the first edition).&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve got another couple of Apress books on their way too, and Jesse Liberty&amp;#39;s &amp;quot;Programming C# 3.0&amp;quot;.&lt;/p&gt;
&lt;p&gt;@Everyone: Bear with me while I try to get all this fixed. If I can&amp;#39;t sort it out, I&amp;#39;ll just make the comments show up the whole time, at least for now.&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648568" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648567</link><pubDate>Mon, 22 Sep 2008 21:23:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648567</guid><dc:creator>Peter</dc:creator><description>&lt;p&gt;Thanks for the review.&lt;/p&gt;
&lt;p&gt;I really hope you do a review of CLR via C# 2ed (Jeffrey Richter) one day.&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648567" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648566</link><pubDate>Mon, 22 Sep 2008 21:03:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648566</guid><dc:creator>peted</dc:creator><description>&lt;p&gt;By the way, just looking at the HTML source, it seems that the problem is as basic as the attached script simply being incomplete. &amp;nbsp;It reads as follows:&lt;/p&gt;
&lt;p&gt;function hideOrShowComments(link)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;var divs = link.parentNode.parentNode.getElementsByTagName(&amp;quot;div&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;for (i=0; i &lt;/p&gt;
&lt;p&gt;Note that it&amp;#39;s just stops. &amp;nbsp;Probably there should have been a &amp;lt; where you have an angle-bracket. &amp;nbsp;:)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648566" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648565</link><pubDate>Mon, 22 Sep 2008 20:42:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648565</guid><dc:creator>peted</dc:creator><description>&lt;p&gt; &amp;nbsp; &amp;nbsp;the link below should toggle the visibility of the comments.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;It&amp;#39;s relatively simple stuff, but my CSS and JavaScript are not what&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;they might be - so let me know if it all goes pear-shaped&lt;/p&gt;
&lt;p&gt;It seems to have gone pear-shaped. &amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;On Safari (Mac), Opera (Mac), and IE8 (Windows), I was unabled to get the comments to be shown by clicking the &amp;quot;Show/hide comments&amp;quot; link.&lt;/p&gt;
&lt;p&gt;On a related note, the comments _do_ show up in the RSS feed, but of course they are unformatted and so very difficult to distinguish from the main article. I&amp;#39;m a fan of summaries in RSS, at least in this sort of context where the article itself may be very long, and in this particular example using a summary would force readers to view the article as it was originally intended (i.e. without comments first, then going back and seeing the &amp;quot;director&amp;#39;s commentary&amp;quot; :) ).&lt;/p&gt;
&lt;p&gt;Of course, I suppose that while the implementation is in fact pear-shaped, the RSS feed makes for a reasonable work-around. &amp;nbsp;:)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648565" width="1" height="1"&gt;</description></item><item><title>re: Book review: Pro LINQ - Language Integrated Query in C# 2008, by Joe Rattz</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx#1648559</link><pubDate>Mon, 22 Sep 2008 19:44:38 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648559</guid><dc:creator>Jesper</dc:creator><description>&lt;p&gt;The onclick handler got stripped by the weblog software, it seems.&lt;/p&gt;
&lt;p&gt;(Hello, by the way, from an old friend from W2W. I&amp;#39;ve enjoyed reading your C# stuff for some time now.)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648559" width="1" height="1"&gt;</description></item></channel></rss>