<?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: Using &quot;var&quot; to simplify code and avoid redundancy</title>
	<atom:link href="http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html</link>
	<description>Productive software development using ASP.NET, C#, Adobe Flex, and other technologies and tools.</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:52:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Charles M</title>
		<link>http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html/comment-page-1#comment-1819</link>
		<dc:creator>Charles M</dc:creator>
		<pubDate>Wed, 19 Jan 2011 19:19:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html#comment-1819</guid>
		<description>The point that it saves you typing the variable type twice is @#$!... Ever hear of intellisence?

If I type: 

List&lt;Dictionary&gt; temp = 

intellisence will auto-complete my data type for me the second time without the need for me to type it so this point is completely void.

It might help when changing types, but that that also might actually hide problems that arise from type changes elsewhere (calling a function)...

All I know is that var is being seriously abused and is leading to seriously unreadable code.

I use vars, but I use them sparingly.  Unfortunately the same group of .NET programmers that think memory management is no longer a concern and leave dangling memory references all over the place in their code (and hence keep the GC from doing it&#039;s job) will likely be the first to jump on the use var everywhere bandwagon.</description>
		<content:encoded><![CDATA[<p>The point that it saves you typing the variable type twice is @#$!&#8230; Ever hear of intellisence?</p>
<p>If I type: </p>
<p>List&lt;Dictionary&gt; temp = </p>
<p>intellisence will auto-complete my data type for me the second time without the need for me to type it so this point is completely void.</p>
<p>It might help when changing types, but that that also might actually hide problems that arise from type changes elsewhere (calling a function)&#8230;</p>
<p>All I know is that var is being seriously abused and is leading to seriously unreadable code.</p>
<p>I use vars, but I use them sparingly.  Unfortunately the same group of .NET programmers that think memory management is no longer a concern and leave dangling memory references all over the place in their code (and hence keep the GC from doing it&#8217;s job) will likely be the first to jump on the use var everywhere bandwagon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Understanding LINQ and LINQ to SQL (and EF)</title>
		<link>http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html/comment-page-1#comment-1590</link>
		<dc:creator>Understanding LINQ and LINQ to SQL (and EF)</dc:creator>
		<pubDate>Thu, 17 Sep 2009 15:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html#comment-1590</guid>
		<description>[...] Using “var” to simplify code and avoid redundancy [...]</description>
		<content:encoded><![CDATA[<p>[...] Using “var” to simplify code and avoid redundancy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Stodola</title>
		<link>http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html/comment-page-1#comment-541</link>
		<dc:creator>Josh Stodola</dc:creator>
		<pubDate>Wed, 25 Jun 2008 22:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html#comment-541</guid>
		<description>To hell with var.  If you don&#039;t like redundancy in your variable declarations, be a man and switch to the .NET superior: VB.</description>
		<content:encoded><![CDATA[<p>To hell with var.  If you don&#8217;t like redundancy in your variable declarations, be a man and switch to the .NET superior: VB.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JV</title>
		<link>http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html/comment-page-1#comment-540</link>
		<dc:creator>JV</dc:creator>
		<pubDate>Wed, 25 Jun 2008 20:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html#comment-540</guid>
		<description>I prefer to see &quot;var&quot; as a wolf in sheep clothes, some day it will bite you in your ase because of the issues you meant last.

Usings have more usages then just taking up space btw, it shows you your depencies and that&#039;s very usefull!</description>
		<content:encoded><![CDATA[<p>I prefer to see &#8220;var&#8221; as a wolf in sheep clothes, some day it will bite you in your ase because of the issues you meant last.</p>
<p>Usings have more usages then just taking up space btw, it shows you your depencies and that&#8217;s very usefull!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Obishawn</title>
		<link>http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html/comment-page-1#comment-539</link>
		<dc:creator>Obishawn</dc:creator>
		<pubDate>Wed, 25 Jun 2008 20:34:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2008/06/using-var-to-simplify-code-and-avoid-redundancy.html#comment-539</guid>
		<description>In regards to your last example, I just ran into that today where I had IShape shape = GetShape() where returned an object of type Shape.  The nice thing is, Resharper did not complain telling me I should have switched that to var.  It must have realized that I wanted to impose that kind of restriction on that object or something.  Funny thing is, I didn&#039;t mean to use the interface for that since GetShape() actually returned a Shape object, so I did convert to using var.

Another benefit falls where you said it might be questionable.  var data = GetData().  Let&#039;s say you had var data = repo.GetData() and it returned an object of type MyData where MyData is in a completely different name space.  Using var actually saves me an using for a single class (or having to type out the namespace before the class to avoid the namespace).

Hopefully that all made sense.</description>
		<content:encoded><![CDATA[<p>In regards to your last example, I just ran into that today where I had IShape shape = GetShape() where returned an object of type Shape.  The nice thing is, Resharper did not complain telling me I should have switched that to var.  It must have realized that I wanted to impose that kind of restriction on that object or something.  Funny thing is, I didn&#8217;t mean to use the interface for that since GetShape() actually returned a Shape object, so I did convert to using var.</p>
<p>Another benefit falls where you said it might be questionable.  var data = GetData().  Let&#8217;s say you had var data = repo.GetData() and it returned an object of type MyData where MyData is in a completely different name space.  Using var actually saves me an using for a single class (or having to type out the namespace before the class to avoid the namespace).</p>
<p>Hopefully that all made sense.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

