DNK has a spanking new server up and running like clockwork. Stability problems are a thing of the past. Our new monitoring service reports 100% uptime since the move!
5
kicks
submitted by johnrudy 11 months, 26 days ago

codeheaven.info — Brief rant about C#'s var keyword. Short version: Aside from anonymous types ... what's the big deal?

Add a comment 1 comment | category: | Views: 28 | Get KickIt image code
I don't get var
tags: , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
I couldn't comment in your blog, so I'll do it in here:

I think the var was put in C# 3.0 primarily to support LINQ-queries that return anonymous types. In LINQ you can return any kind of objects with variable amount of columns or properties (defined in the select-part).

This ScottGu's article explains it well from the LINQ-perspective, too:
http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx
posted by Jemm Jemm 11 months, 26 days ago



information Login or create an account to comment on this story

Related Stories:
 

Search: