<?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: C# 3.0&#8217;s var keyword: Jeff Atwood gets it all wrong</title>
	<atom:link href="http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/feed/" rel="self" type="application/rss+xml" />
	<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/</link>
	<description>Adventures of a young kiwi software developer in London</description>
	<lastBuildDate>Tue, 09 Mar 2010 23:02:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Implicitly typed variables in C# using var &#171; This one goes to 11</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-2314</link>
		<dc:creator>Implicitly typed variables in C# using var &#171; This one goes to 11</dc:creator>
		<pubDate>Fri, 27 Feb 2009 03:08:13 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-2314</guid>
		<description>[...] inspiration to chime in on this topic came from this blog post.</description>
		<content:encoded><![CDATA[<p>[...] inspiration to chime in on this topic came from this blog post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rickey Ward</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-1909</link>
		<dc:creator>Rickey Ward</dc:creator>
		<pubDate>Tue, 20 Jan 2009 02:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-1909</guid>
		<description>I agree with this article, I myself even when using non strict languages, for example as in flash, I always strict data type my variables. I would like for those languages to give me an option of using data types as a declaration, so instead of string name = &quot;Rick&quot;; im stuck with var name:String = &quot;Rick&quot;; strict is the way to go. Its easier to read, and understand. its easy to loose track of a complicated application with hundreds of variables, I look for those data types to help me remember what my variables are intended to help me do.

and also, a short hand method would be nice, but i don&#039;t mind the typing, especially with VS2k8 all you have to do is type the first letter of the type after typing new and then hit enter and its auto completed.

Every programmer has their own preference.
happy coding</description>
		<content:encoded><![CDATA[<p>I agree with this article, I myself even when using non strict languages, for example as in flash, I always strict data type my variables. I would like for those languages to give me an option of using data types as a declaration, so instead of string name = &#8220;Rick&#8221;; im stuck with var name:String = &#8220;Rick&#8221;; strict is the way to go. Its easier to read, and understand. its easy to loose track of a complicated application with hundreds of variables, I look for those data types to help me remember what my variables are intended to help me do.</p>
<p>and also, a short hand method would be nice, but i don&#8217;t mind the typing, especially with VS2k8 all you have to do is type the first letter of the type after typing new and then hit enter and its auto completed.</p>
<p>Every programmer has their own preference.<br />
happy coding</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Paldino</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-1616</link>
		<dc:creator>Nicholas Paldino</dc:creator>
		<pubDate>Wed, 17 Dec 2008 23:05:37 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-1616</guid>
		<description>@Richard:

If you want to support this in the language, then vote for the suggestion at the Microsoft Connect site:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=388649</description>
		<content:encoded><![CDATA[<p>@Richard:</p>
<p>If you want to support this in the language, then vote for the suggestion at the Microsoft Connect site:</p>
<p><a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=388649" rel="nofollow">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=388649</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Paldino</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-1610</link>
		<dc:creator>Nicholas Paldino</dc:creator>
		<pubDate>Wed, 17 Dec 2008 21:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-1610</guid>
		<description>Sorry for the late, LATE response to this, but I wanted to say thank you for quoting me.

@Jonathan Allen: I should have elaborated, but what I meant by that was this is something that should be included in the language.  You are absolutely right that it can&#039;t be done now.  I have recommended it to Mads at MS though, but I don&#039;t know if it gained any traction.

@Buu Nguyen: My recommendation (if it was implemented) does not make using the type on the right-hand side an error.  You could still use it, just the same as you would before (and it would have to be that way, since there would be all that legacy code to support).</description>
		<content:encoded><![CDATA[<p>Sorry for the late, LATE response to this, but I wanted to say thank you for quoting me.</p>
<p>@Jonathan Allen: I should have elaborated, but what I meant by that was this is something that should be included in the language.  You are absolutely right that it can&#8217;t be done now.  I have recommended it to Mads at MS though, but I don&#8217;t know if it gained any traction.</p>
<p>@Buu Nguyen: My recommendation (if it was implemented) does not make using the type on the right-hand side an error.  You could still use it, just the same as you would before (and it would have to be that way, since there would be all that legacy code to support).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-1225</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Wed, 19 Nov 2008 11:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-1225</guid>
		<description>Nice post and I understand the debate, but I don&#039;t agree with the poster.

First: declaring lots of (local) variables is a sign of bad coding practices, in my opinion. Second: having to know the type of a variable to be able to understand your code is a sign of bad naming practices, in my opinion. 

And to those that say that this will generate more run-time errors: please read up on the subject again. There is no dynamic typing going on when using var.

So to me, it seems like a bad idea to do both, using a lot of explicit type declarations OR var&#039;s - but if you must, use var, as it is shorter and the type information is right at your mouse pointer if you really do need it.</description>
		<content:encoded><![CDATA[<p>Nice post and I understand the debate, but I don&#8217;t agree with the poster.</p>
<p>First: declaring lots of (local) variables is a sign of bad coding practices, in my opinion. Second: having to know the type of a variable to be able to understand your code is a sign of bad naming practices, in my opinion. </p>
<p>And to those that say that this will generate more run-time errors: please read up on the subject again. There is no dynamic typing going on when using var.</p>
<p>So to me, it seems like a bad idea to do both, using a lot of explicit type declarations OR var&#8217;s &#8211; but if you must, use var, as it is shorter and the type information is right at your mouse pointer if you really do need it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-916</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Mon, 20 Oct 2008 06:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-916</guid>
		<description>Great post</description>
		<content:encoded><![CDATA[<p>Great post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-735</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Thu, 11 Sep 2008 12:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-735</guid>
		<description>My fellow developers and I have had extensive conversations on this subject and have for the most part agreed to disagree.  There are points to both sides of the argument here.

Explicitly typing
1) in cases of initialization by a method or function explicitly typing makes the code more clear.
2) When in need of a variable that you can&#039;t initialize right away (although this should be rare).

Implicitly typing
1) when initializing a variable in c# the part on the right hand side of the = is more important than what is on the left.  example

List names = new List {&quot;Tony&quot;, &quot;Bob&quot;, &quot;Mike&quot;, &quot;Phil&quot;};

Developers for typing say that adding var makes it less clear here because it doesn&#039;t tell them what &quot;names&quot; is right away.  To which I respond that is the point.  You need to look past the left declaration and focus on the right which has more going on than just declaring an empty list.

2) using var with initialized variables does remove the redundancy and make code easier to read.</description>
		<content:encoded><![CDATA[<p>My fellow developers and I have had extensive conversations on this subject and have for the most part agreed to disagree.  There are points to both sides of the argument here.</p>
<p>Explicitly typing<br />
1) in cases of initialization by a method or function explicitly typing makes the code more clear.<br />
2) When in need of a variable that you can&#8217;t initialize right away (although this should be rare).</p>
<p>Implicitly typing<br />
1) when initializing a variable in c# the part on the right hand side of the = is more important than what is on the left.  example</p>
<p>List names = new List {&#8220;Tony&#8221;, &#8220;Bob&#8221;, &#8220;Mike&#8221;, &#8220;Phil&#8221;};</p>
<p>Developers for typing say that adding var makes it less clear here because it doesn&#8217;t tell them what &#8220;names&#8221; is right away.  To which I respond that is the point.  You need to look past the left declaration and focus on the right which has more going on than just declaring an empty list.</p>
<p>2) using var with initialized variables does remove the redundancy and make code easier to read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Amada</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-302</link>
		<dc:creator>Ben Amada</dc:creator>
		<pubDate>Sun, 27 Jul 2008 14:30:15 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-302</guid>
		<description>For any good sized project, I would much rather variables be declared with an explicit type.  Code is written once.  The same code is read many more times for maintenance and subsequent modifications.  More time will be lost trying to refamiliarize yourself with the intended types each time you review code containing a large number of inferred types than the time saved not explicitly stating the type in the first place.

As Manav stated (in post # 24 above), what happens when a function&#039;s return type changes?  The change may or may not cause undesirable effects in code that is calling the function.  But why take the chance?  I&#039;d also like to avoid the possibility of a future version of the compiler inferring the type of a variable differently.  As stated by others, in VS, you can hover over a &quot;var&quot; declared variable to see its type via intellisense.  There are times, however, when I am looking at code outside of VS and intellisense is not available.</description>
		<content:encoded><![CDATA[<p>For any good sized project, I would much rather variables be declared with an explicit type.  Code is written once.  The same code is read many more times for maintenance and subsequent modifications.  More time will be lost trying to refamiliarize yourself with the intended types each time you review code containing a large number of inferred types than the time saved not explicitly stating the type in the first place.</p>
<p>As Manav stated (in post # 24 above), what happens when a function&#8217;s return type changes?  The change may or may not cause undesirable effects in code that is calling the function.  But why take the chance?  I&#8217;d also like to avoid the possibility of a future version of the compiler inferring the type of a variable differently.  As stated by others, in VS, you can hover over a &#8220;var&#8221; declared variable to see its type via intellisense.  There are times, however, when I am looking at code outside of VS and intellisense is not available.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: I don't get var - Code Heaven</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-184</link>
		<dc:creator>I don't get var - Code Heaven</dc:creator>
		<pubDate>Mon, 07 Jul 2008 22:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-184</guid>
		<description>[...] than the second variation. As IanG noted in 2005, Var Isn&#039;t Object, and more recently, Richard Dingwall exposed the differences between it and genuine variants -- it provides full strong-typing, and the [...]</description>
		<content:encoded><![CDATA[<p>[...] than the second variation. As IanG noted in 2005, Var Isn&#39;t Object, and more recently, Richard Dingwall exposed the differences between it and genuine variants &#8212; it provides full strong-typing, and the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Berridge</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-144</link>
		<dc:creator>Kevin Berridge</dc:creator>
		<pubDate>Wed, 25 Jun 2008 12:08:50 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-144</guid>
		<description>I definitely agree with you on this.  Readability trumps write-ability in all but the most extreme cases in my book.  

It&#039;s considerably easier to read the left hand side of the &quot;A thing = new A()&quot; statement than the right hand side.  This is because the left hand side always starts in the same column and therefore can be easily scanned.  If you start seeing &quot;var thing = ...&quot; you have to stop and start scanning to the right to figure out what the type will be.  This is an example of one of those small efforts that adds up over time that Jeff Atwood posted about &lt;a href=&quot;http://www.codinghorror.com/blog/archives/001139.html&quot; rel=&quot;nofollow&quot;&gt;yesterday&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I definitely agree with you on this.  Readability trumps write-ability in all but the most extreme cases in my book.  </p>
<p>It&#8217;s considerably easier to read the left hand side of the &#8220;A thing = new A()&#8221; statement than the right hand side.  This is because the left hand side always starts in the same column and therefore can be easily scanned.  If you start seeing &#8220;var thing = &#8230;&#8221; you have to stop and start scanning to the right to figure out what the type will be.  This is an example of one of those small efforts that adds up over time that Jeff Atwood posted about <a href="http://www.codinghorror.com/blog/archives/001139.html" rel="nofollow">yesterday</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
