Click here to Skip to main content
15,895,798 members

Survey Results

How often do you use the var type in C#? (1= never, 5=always)   [Edit]

Survey period: 17 Aug 2009 to 24 Aug 2009

The var keyword can be a saint or a sinner. Choose "1" if you never use var in this scenario (or never use that scenario), up to "5" for always, whenever possible. (Suggested by Asher)

OptionVotes12345 
In normal C# coding (1 = you don"t code in C#, 5=for all C# variables possible)9370%0%0%0%0%
With LINQ9370%0%0%0%0%
For declaring complex types9370%0%0%0%0%
For using complex types (eg in foreach loops)9370%0%0%0%0%
With anonymous types9370%0%0%0%0%
When it saves typing9370%0%0%0%0%
When it makes the code look better (to you)9370%0%0%0%0%

View optional text answers (46 answers)


 
GeneralWhere What and How Pin
drweb8619-Aug-09 20:31
drweb8619-Aug-09 20:31 
GeneralTake a look at the C# language specification Pin
Jörgen Sigvardsson19-Aug-09 7:45
Jörgen Sigvardsson19-Aug-09 7:45 
GeneralRe: Take a look at the C# language specification Pin
Adam Maras19-Aug-09 19:30
Adam Maras19-Aug-09 19:30 
Generalvar is Awesome! Pin
Dale Thompson18-Aug-09 8:42
Dale Thompson18-Aug-09 8:42 
GeneralRe: var is Awesome! Pin
nsimeonov18-Aug-09 10:58
nsimeonov18-Aug-09 10:58 
Yes, but it makes C# look like javascript. Let's put a $ sign in front of every variable to make it look like PHP then. Besides strong types are recommended for function parameters. Lazy coding not always pays off in the long run.
GeneralRe: var is Awesome! Pin
yassir hannoun18-Aug-09 11:16
yassir hannoun18-Aug-09 11:16 
GeneralRe: var is Awesome! Pin
Hal Angseesing25-Aug-09 6:31
professionalHal Angseesing25-Aug-09 6:31 
GeneralIt hinders backward compatibility [modified] Pin
PIEBALDconsult18-Aug-09 6:55
mvePIEBALDconsult18-Aug-09 6:55 
Generalvar works in .NET 2.0... Pin
Dale Thompson18-Aug-09 8:44
Dale Thompson18-Aug-09 8:44 
GeneralRe: var works in .NET 2.0... Pin
PIEBALDconsult18-Aug-09 9:05
mvePIEBALDconsult18-Aug-09 9:05 
GeneralFunctional Languages Pin
Kevin McFarlane18-Aug-09 1:16
Kevin McFarlane18-Aug-09 1:16 
General"CCtrlList" <- Pin
fkhg117-Aug-09 20:54
fkhg117-Aug-09 20:54 
GeneralRe: "CCtrlList" <- Pin
Marc Clifton18-Aug-09 15:58
mvaMarc Clifton18-Aug-09 15:58 
GeneralMade Me Uncomfortable, but PinPopular
W Balboos, GHB17-Aug-09 6:03
W Balboos, GHB17-Aug-09 6:03 
GeneralOh, get over it! Pin
David Veeneman17-Aug-09 5:53
David Veeneman17-Aug-09 5:53 
GeneralRe: Oh, get over it! Pin
Netblue17-Aug-09 7:35
Netblue17-Aug-09 7:35 
GeneralRe: Oh, get over it! Pin
David Veeneman17-Aug-09 12:25
David Veeneman17-Aug-09 12:25 
GeneralRe: Oh, get over it! Pin
PIEBALDconsult17-Aug-09 13:04
mvePIEBALDconsult17-Aug-09 13:04 
GeneralRe: Oh, get over it! Pin
AlwiNus17-Aug-09 15:37
AlwiNus17-Aug-09 15:37 
GeneralRe: Oh, get over it! Pin
JoseMenendez21-Aug-09 11:25
JoseMenendez21-Aug-09 11:25 
JokeA missing option Pin
Nemanja Trifunovic17-Aug-09 5:03
Nemanja Trifunovic17-Aug-09 5:03 
GeneralRe: A missing option Pin
Abhishek Sur20-Aug-09 22:31
professionalAbhishek Sur20-Aug-09 22:31 
Generalvar is ugly PinPopular
Huisheng Chen17-Aug-09 3:08
Huisheng Chen17-Aug-09 3:08 
GeneralRe: var is ugly Pin
Xmen Real 17-Aug-09 3:35
professional Xmen Real 17-Aug-09 3:35 
GeneralRe: var is ugly Pin
Todd Smith17-Aug-09 13:04
Todd Smith17-Aug-09 13:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.