DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

2
kicks
submitted by isuttle isuttle 1 year, 1 month ago

iansuttle.com — C# 3.0 introduces implicitly typed local variables by way of the keyword “var”. The use of var allows one to assign a number of different types to a variable without explicitly stating that variable’s type. Var is actually not a type at all, but a keyword which instructs the compiler to infer the most appropriate type based on the value or expression to the right of the equals sign.

Add a comment 2 comments | category: | Views: 1 | Get KickIt image code
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:
Lots of lazy ass programmers are going to be loading their code with var's. I can hardly wait until I have to use a framework with something like this in it:
LazyObject.PerformSomeFunction(var zzz);
posted by yesthatmcgurk yesthatmcgurk 1 year, 1 month ago
Lol - I do agree there's a risk of that as noted in the article. Luckily VS maintains knowledge of the underlying type, but readability would certainly be degraded.
posted by isuttle isuttle 1 year ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge