Click here to Skip to main content
15,893,266 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)


 
GeneralRe: Never!!! Pin
Netblue17-Aug-09 7:42
Netblue17-Aug-09 7:42 
GeneralRe: Never!!! Pin
PIEBALDconsult17-Aug-09 13:11
mvePIEBALDconsult17-Aug-09 13:11 
GeneralRe: Never!!! Pin
keozcigisoft17-Aug-09 17:36
keozcigisoft17-Aug-09 17:36 
GeneralRe: Never!!! Pin
PIEBALDconsult17-Aug-09 18:01
mvePIEBALDconsult17-Aug-09 18:01 
GeneralRe: Never!!! Pin
Kevin McFarlane18-Aug-09 1:13
Kevin McFarlane18-Aug-09 1:13 
GeneralRe: Never!!! Pin
keozcigisoft18-Aug-09 8:03
keozcigisoft18-Aug-09 8:03 
GeneralRe: Never!!! Pin
PIEBALDconsult18-Aug-09 9:06
mvePIEBALDconsult18-Aug-09 9:06 
GeneralRe: Never!!! [modified] Pin
louthy19-Aug-09 4:50
louthy19-Aug-09 4:50 
Why don't you write in assembler then? Cut out all the middle-men. Do you do all of your own memory management too? Because surely you don't trust the garbage collector and can implement it much better yourself?

Ludicrous argument. Language tools are there to make the process of programming easier, so we can develop larger, more complex and feature rich applications. It's that mentality of 'the old ways are the best' which makes developing large applications with blinkered team-members painful.

I'm not advocating jumping on every bandwagon. But where new language features come along which make the process of development more intuitive, then they should be considered. Linq is much more than an ADO.NET wrapper, and if you bother to read up on it you may realise that.

modified on Wednesday, August 19, 2009 2:12 PM

GeneralRe: Never!!! Pin
sucram19-Aug-09 20:45
sucram19-Aug-09 20:45 
GeneralNever Pin
Fahad Sadah16-Aug-09 20:37
Fahad Sadah16-Aug-09 20:37 
GeneralRe: Never Pin
Member 448708317-Aug-09 0:58
Member 448708317-Aug-09 0:58 
GeneralRe: Never Pin
Randall Woodman17-Aug-09 3:48
Randall Woodman17-Aug-09 3:48 
GeneralRe: Never Pin
CDMTJX17-Aug-09 4:25
CDMTJX17-Aug-09 4:25 
GeneralRe: Never Pin
louthy17-Aug-09 4:34
louthy17-Aug-09 4:34 
GeneralRe: Never Pin
CDMTJX17-Aug-09 7:05
CDMTJX17-Aug-09 7:05 
GeneralRe: Never Pin
Kevin McFarlane18-Aug-09 1:08
Kevin McFarlane18-Aug-09 1:08 
GeneralRe: Never Pin
keozcigisoft17-Aug-09 7:00
keozcigisoft17-Aug-09 7:00 
GeneralRe: Never Pin
0x3c018-Aug-09 6:35
0x3c018-Aug-09 6:35 

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.