Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
DZone MVB

Links

Social

var is like (good) wine

Keyword var is cool thing we can use to make our code more readable for other programmers and why not - reviewers. But var can also be used to make our code difficult to understand. In this case, lte's say, we are overusing var. So, var is like wine - if one takes glass of it then everything is okay in the morning, but if somebody takes it couple of bottles then the morning will be awful. Or let's say - too much var will kill you?

 

NB! This blog is moved to gunnarpeipman.com

Click here to go to article

Comments

gstarbuck said:

Good observations.  I have been loving using the "var" keyword, but I definitely agree that is is inappropriate in some places.

# July 12, 2008 10:40 PM

Dew Drop - July 13, 2008 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - July 13, 2008 | Alvin Ashcraft's Morning Dew

# July 13, 2008 12:08 PM

Greg M said:

Your IDE should tell you the type of x!

# July 15, 2008 1:15 AM

DigiMortal said:

Yes, Greg, it does. But when I'm reading the code I don't want any avoidable problems to interrupt my mindwork.

# July 15, 2008 2:02 AM