<?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>You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx</link><description>LINQ is clearly gaining a fair amount of traction, given the number of posts I see about it on Stack Overflow . However, I&amp;#39;ve noticed an interesting piece of coding style: a lot of developers are using query expressions for every bit of LINQ they</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Query Language or Method calls: A matter of taste</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1692318</link><pubDate>Mon, 11 May 2009 17:52:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1692318</guid><dc:creator>Bill Blogs in C#</dc:creator><description>&lt;p&gt;My last post (which was too long ago), generated question on whether I prefer the query language or the&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1692318" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1673815</link><pubDate>Wed, 25 Feb 2009 17:39:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1673815</guid><dc:creator>Vladimir Kelman</dc:creator><description>&lt;p&gt;@Jon,&lt;/p&gt;
&lt;p&gt;A first &amp;quot;query expression&amp;quot; example, with its two &amp;quot;from&amp;quot; lines one after another, looks surprisingly similar to Scala for expression syntax. Inside Scala&amp;#39;s &amp;quot;for&amp;quot; you can also do it: select files from a directory, select lines from files, filter results and then use it inside {} block of &amp;quot;for&amp;quot;. That&amp;#39;s one of examples in &amp;quot;Programming in Scala&amp;quot; &lt;a rel="nofollow" target="_new" href="http://booksites.artima.com/programming_in_scala"&gt;booksites.artima.com/programming_in_scala&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1673815" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1661106</link><pubDate>Mon, 12 Jan 2009 12:25:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1661106</guid><dc:creator>Stuart Caborn</dc:creator><description>&lt;p&gt;It is interesting that most of the usages in LINQ (&amp;gt;90%$) use the sugar free syntax. &amp;nbsp;It just seems more natural in many situations. &amp;nbsp;It could be that for a C# developer there is less of an impedance mismatch when you look at the traditional syntax over a query expression.&lt;/p&gt;
&lt;p&gt;I certainly find I have to think a little harder about LINQ which is written using the expression syntax.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1661106" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1660013</link><pubDate>Fri, 09 Jan 2009 18:21:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1660013</guid><dc:creator>Mike Strobel</dc:creator><description>&lt;p&gt;It&amp;#39;s funny, I originally used query expressions &amp;nbsp;because they were so heavily advertised and they had a certain novelty. &amp;nbsp;Nowadays, I often forget they even exist. &amp;nbsp;I use LINQ all the time, but I virtually never use query expressions unless I really need to declare an intermediate with &amp;#39;let&amp;#39;. &amp;nbsp;Once you get comfortable with the standard LINQ operators, you can leverage the framework much more effectively (and often more efficiently) using the extension methods.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1660013" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659987</link><pubDate>Fri, 09 Jan 2009 16:48:16 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659987</guid><dc:creator>Andrew</dc:creator><description>&lt;p&gt;I&amp;#39;ve heard Luke Hoban saying that query expressions were introduced in C# because the learning curve for LINQ still was quite high. &lt;/p&gt;
&lt;p&gt;And to that point, I&amp;#39;m really interested in the percentage of those who use expressions (&amp;quot;from .. in .. select ..&amp;quot;) among the whole bunch of us using LINQ. &lt;/p&gt;
&lt;p&gt;Cause from what I can see, it&amp;#39;s just a tiny fraction of &amp;quot;expressionists&amp;quot;. Maybe it could have been a wiser choice to introduce LINQ and *then* consider changing the language??&lt;/p&gt;
&lt;p&gt;Just curious. I might be wrong, of course.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659987" width="1" height="1"&gt;</description></item><item><title>Arjan`s World</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659866</link><pubDate>Thu, 08 Jan 2009 21:55:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659866</guid><dc:creator>Arjan`s World</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Arjan`s World&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659866" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659375</link><pubDate>Thu, 08 Jan 2009 16:07:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659375</guid><dc:creator>Omer Mor</dc:creator><description>&lt;p&gt;I agree. This could be a perfect refactoring tip in ReSharper.&lt;/p&gt;
&lt;p&gt;Today (for example) it suggests to invert &amp;quot;if&amp;quot; statements, if it can make the code shorter and less indented.&lt;/p&gt;
&lt;p&gt;It could easily find LINQ expressions that could be shortened by their equivalent query expressions, and offer to convert them for you.&lt;/p&gt;
&lt;p&gt;JetBrains: The ball is in your court :-)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659375" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659286</link><pubDate>Thu, 08 Jan 2009 14:30:52 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659286</guid><dc:creator>Justin Davies</dc:creator><description>&lt;p&gt;As you say it depends on the complexity, but pretty simple ones still sometimes look better with the sugar. For example take the following which has a mix of styles:&lt;/p&gt;
&lt;p&gt;return (from d in descendants where d.Key == descendantKey select d.Value).Single();&lt;/p&gt;
&lt;p&gt;in dot notation:&lt;/p&gt;
&lt;p&gt;return descendants.Where(d =&amp;gt; d.Key == descendantKey).Select(d =&amp;gt; d.Value).Single();&lt;/p&gt;
&lt;p&gt;Either works for me, but I&amp;#39;m pretty sure the first is more readable to all skill levels of LINQ.&lt;/p&gt;
&lt;p&gt;Marc has a great point in that anything outside the sugar can easily be missed if you rely on it... I&amp;#39;m thinking perhaps I should always code in dot notation first and if ugly see if I can then sugar it, rather than the other way around.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659286" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659221</link><pubDate>Thu, 08 Jan 2009 12:24:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659221</guid><dc:creator>Vincent Croquette</dc:creator><description>&lt;p&gt;Thanks Marc &lt;/p&gt;
&lt;p&gt;Usually I just need to maintain the application and try to respect the same coding techniques as for the rest of the application.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d love to change all those FindAll(delegate) but it is not worth the effort&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659221" width="1" height="1"&gt;</description></item><item><title>Reflective Perspective - Chris Alcock  &amp;raquo; The Morning Brew #260</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659129</link><pubDate>Thu, 08 Jan 2009 08:51:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659129</guid><dc:creator>Reflective Perspective - Chris Alcock  » The Morning Brew #260</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Reflective Perspective - Chris Alcock &amp;nbsp;&amp;raquo; The Morning Brew #260&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659129" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659120</link><pubDate>Thu, 08 Jan 2009 08:33:01 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659120</guid><dc:creator>Marc Gravell</dc:creator><description>&lt;p&gt;@Vincent - don&amp;#39;t forget that you can use LINQ (to objects, at least) with .NET 2.0 (as long as you are using C# 3.0) via things like LINQBridge.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659120" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659118</link><pubDate>Thu, 08 Jan 2009 08:31:30 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659118</guid><dc:creator>Marc Gravell</dc:creator><description>&lt;p&gt;@CQ - the &amp;quot;+1&amp;quot; made me laugh ;-p&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659118" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1659116</link><pubDate>Thu, 08 Jan 2009 08:30:22 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1659116</guid><dc:creator>Marc Gravell</dc:creator><description>&lt;p&gt;Agreed. Add to that the number of overloads and additional methods (both standard and bespoke) that can *only* be called through dot syntax. &lt;/p&gt;
&lt;p&gt;From what I&amp;#39;ve seen, people with too much query-syntax affinity regularly miss out on a simple, elegant way to do something simply because query-syntax can&amp;#39;t express it. Even simple *core* things like Skip/Take.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1659116" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1658903</link><pubDate>Thu, 08 Jan 2009 00:28:50 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658903</guid><dc:creator>Almond</dc:creator><description>&lt;p&gt;I think some of this is from the fact that alot of developers introduction to LINQ is through LINQ to SQL examples. I think this sometimes leads some developers to write all LINQ code like they would an SQL statement. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658903" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1658900</link><pubDate>Thu, 08 Jan 2009 00:18:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658900</guid><dc:creator>Fowl</dc:creator><description>&lt;p&gt;Wow, it&amp;#39;s the exact opposite for me, where query expressions seem like black magic, whereas a method call seems understandable. &lt;/p&gt;
&lt;p&gt;I could use that aspect without reading any documentation outside of intellisense, yay for discoverablility. :)&lt;/p&gt;
&lt;p&gt;Of course I don&amp;#39;t know SQL, and only use LINQ to Objects.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658900" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1658882</link><pubDate>Wed, 07 Jan 2009 23:06:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658882</guid><dc:creator>CQ</dc:creator><description>&lt;p&gt;I agree, I see a fair amount of the more verbose syntax from fellow developers for such simple queries and at a glance (at least to me) the intention isn&amp;#39;t as clear.&lt;/p&gt;
&lt;p&gt;I tried to +1 but I couldn&amp;#39;t find the vote button. &amp;nbsp;Oh yeah this isn&amp;#39;t SO.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658882" width="1" height="1"&gt;</description></item><item><title>You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1658844</link><pubDate>Wed, 07 Jan 2009 20:42:55 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658844</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You&amp;#39;ve been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658844" width="1" height="1"&gt;</description></item><item><title>re: You don't have to use query expressions to use LINQ</title><link>http://msmvps.com/blogs/jon_skeet/archive/2009/01/07/you-don-t-have-to-use-query-expressions-to-use-linq.aspx#1658819</link><pubDate>Wed, 07 Jan 2009 19:33:31 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658819</guid><dc:creator>Vincent Croquette</dc:creator><description>&lt;p&gt;A new developer recently joined the team I work for and explained me he did not like Linq because he does not trust what&amp;#39;s running behind the curtain.&lt;/p&gt;
&lt;p&gt;He does not like declarative programming either (attributes...) and prefers to have everything &amp;#39;under control&amp;#39; imperatively.&lt;/p&gt;
&lt;p&gt;I think you get much more confidence in a technology when you start understanding it rather than just knowing it. This is the main reason why I like books such as &amp;quot;C# in depth&amp;quot;, they allow me to understand how things work and not just write the code from the book blindly.&lt;/p&gt;
&lt;p&gt;Three things I&amp;#39;m sure about still&lt;/p&gt;
&lt;p&gt;Parts of my code are really clearer with Linq and I really miss it when I need it on &amp;lt;3.5 projects&lt;/p&gt;
&lt;p&gt;Other developers from other environments to whom I show Linq (to objects and entities) find it really neat&lt;/p&gt;
&lt;p&gt;Never forget someone else might have to read your code in the future...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658819" width="1" height="1"&gt;</description></item></channel></rss>