<?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&#8242;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>The adventures of a young kiwi software developer in London</description>
	<lastBuildDate>Tue, 31 Jan 2012 19:56:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ed Goble</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-49305</link>
		<dc:creator>Ed Goble</dc:creator>
		<pubDate>Mon, 05 Dec 2011 21:08:51 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-49305</guid>
		<description>I tend to chuckle about philosophical debates like this.
I find that I am most comfortable somewhere in the middle of the two extremes debated here, when something makes sense.  I hate it when people deny that something they are philosophically and ideologically opposed to obviously makes sense.  I think at that point they refuse to admit another party&#039;s rationality, and themselves become irrational.  I think that it is obvious that var should not be used when it obviously makes code hard to read.  But i think those instances are pretty straight forward, just like calling some variable &quot;x&quot; makes it hard to read, when it makes sense for verbosity.  On the other hand, when something is so dang obvious what x represents, then x is fine.  I think that unbending and irrational loyalty to some notion in code is silly and irrational.  I mean, to me, such a thing manifests that code must be somebody&#039;s whole life and they don&#039;t get enough balance in their life from other things.</description>
		<content:encoded><![CDATA[<p>I tend to chuckle about philosophical debates like this.<br />
I find that I am most comfortable somewhere in the middle of the two extremes debated here, when something makes sense.  I hate it when people deny that something they are philosophically and ideologically opposed to obviously makes sense.  I think at that point they refuse to admit another party&#8217;s rationality, and themselves become irrational.  I think that it is obvious that var should not be used when it obviously makes code hard to read.  But i think those instances are pretty straight forward, just like calling some variable &#8220;x&#8221; makes it hard to read, when it makes sense for verbosity.  On the other hand, when something is so dang obvious what x represents, then x is fine.  I think that unbending and irrational loyalty to some notion in code is silly and irrational.  I mean, to me, such a thing manifests that code must be somebody&#8217;s whole life and they don&#8217;t get enough balance in their life from other things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijaya Anand</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-27933</link>
		<dc:creator>Vijaya Anand</dc:creator>
		<pubDate>Fri, 25 Mar 2011 11:06:26 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-27933</guid>
		<description>&quot;var should be used only for anonymous types r a collection of anonymous types&quot; I think we can use more than that.

Instead of,

MyNameSpace.MyClass obj = new MyNameSpace.MyClass()

I prefer,

var obj = new MyNameSpace.MyClass()

But,

Instead of,

var obj = MyMethod();

I prefer,

MyClass obj = MyMethod().</description>
		<content:encoded><![CDATA[<p>&#8220;var should be used only for anonymous types r a collection of anonymous types&#8221; I think we can use more than that.</p>
<p>Instead of,</p>
<p>MyNameSpace.MyClass obj = new MyNameSpace.MyClass()</p>
<p>I prefer,</p>
<p>var obj = new MyNameSpace.MyClass()</p>
<p>But,</p>
<p>Instead of,</p>
<p>var obj = MyMethod();</p>
<p>I prefer,</p>
<p>MyClass obj = MyMethod().</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GM</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-26952</link>
		<dc:creator>GM</dc:creator>
		<pubDate>Wed, 09 Mar 2011 13:44:43 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-26952</guid>
		<description>This argument is simple enough to address.  The use of var outside of its problem domain should be avoided, as it provides no real benefit, yet instills several potential maintenance issues.

Anytime you can avoid potential maintenance or unintended consequences issues, the extra effort is almost always worth while.

Unnecessary and prolific use of var is nearly guaranteed to leave you with difficult to maintain code.  Why even take that chance?

Those of you arguing for intellisense -- I am envious of your perfectly working copies of visual studio.  This feature frequently stops working on all of my copies, usually requiring a recompille to regain its functionality.

Besides, intellisense is not all that useful when sitting in a conference room poring over a code-review on the projector.</description>
		<content:encoded><![CDATA[<p>This argument is simple enough to address.  The use of var outside of its problem domain should be avoided, as it provides no real benefit, yet instills several potential maintenance issues.</p>
<p>Anytime you can avoid potential maintenance or unintended consequences issues, the extra effort is almost always worth while.</p>
<p>Unnecessary and prolific use of var is nearly guaranteed to leave you with difficult to maintain code.  Why even take that chance?</p>
<p>Those of you arguing for intellisense &#8212; I am envious of your perfectly working copies of visual studio.  This feature frequently stops working on all of my copies, usually requiring a recompille to regain its functionality.</p>
<p>Besides, intellisense is not all that useful when sitting in a conference room poring over a code-review on the projector.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RJ</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-19238</link>
		<dc:creator>RJ</dc:creator>
		<pubDate>Mon, 22 Nov 2010 18:35:50 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-19238</guid>
		<description>var should be removed.  I also don&#039;t see how anon types are required.  

I will admit, I do not know linq nor would I use such a blasphemous syntax.  Maybe if I was younger and less bitter.  To me that syntax is like like eating puke that I just puked.  I hate to think what the junior devs are going to do with this crap and the resulting code.</description>
		<content:encoded><![CDATA[<p>var should be removed.  I also don&#8217;t see how anon types are required.  </p>
<p>I will admit, I do not know linq nor would I use such a blasphemous syntax.  Maybe if I was younger and less bitter.  To me that syntax is like like eating puke that I just puked.  I hate to think what the junior devs are going to do with this crap and the resulting code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://richarddingwall.name/2008/06/21/csharps-var-keyword-jeff-atwood-gets-it-all-wrong/comment-page-1/#comment-16687</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Tue, 07 Sep 2010 06:56:23 +0000</pubDate>
		<guid isPermaLink="false">http://richarddingwall.name/?p=88#comment-16687</guid>
		<description>&gt;&quot;`var` says “The type here is not important; Whatever type that expression happens to be, will do.”&quot;

Haha! There&#039;s proof right there that var can cause LAZINESS!

However, removing/restricting the use of var in C# isn&#039;t going to help the unfortunate who already abuse it. Syntax isn&#039;t going to fix laziness, they&#039;ll just find another language...</description>
		<content:encoded><![CDATA[<p>&gt;&#8221;`var` says “The type here is not important; Whatever type that expression happens to be, will do.”&#8221;</p>
<p>Haha! There&#8217;s proof right there that var can cause LAZINESS!</p>
<p>However, removing/restricting the use of var in C# isn&#8217;t going to help the unfortunate who already abuse it. Syntax isn&#8217;t going to fix laziness, they&#8217;ll just find another language&#8230;</p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>

