Click here to Skip to main content
15,899,935 members

Survey Results

Random style question: Which variable declaration do you prefer?

Survey period: 22 Jul 2019 to 29 Jul 2019

Strict formalism or fast and loose? Typesafe or no type at all? For anyone who switches languages often this can get messy.

OptionVotes% 
int count (Standard C-style)76666.78
count: Integer (eg Pascal)342.96
var count: int, or val count: Integer (eg TypeScript)201.74
var count int (eg Go)191.66
Declare @count int (eg SQL)161.39
Dim Count As Integer (eg VB)786.80
Count = 1 or $count = 1 (eg Python or PHP)282.44
(defvar count 1) (eg LISP, and similar in Scheme)20.17
Other272.35
I'm not fussed. Whatever works.15713.69



 
GeneralRe: Typesafe with default value assignment Pin
#realJSOP22-Jul-19 9:22
professional#realJSOP22-Jul-19 9:22 
GeneralC# var - nice compromise Pin
honey the codewitch22-Jul-19 2:30
mvahoney the codewitch22-Jul-19 2:30 
GeneralVar Wars Pin
PeejayAdams22-Jul-19 1:20
PeejayAdams22-Jul-19 1:20 
GeneralRe: Var Wars Pin
KarstenK22-Jul-19 1:46
mveKarstenK22-Jul-19 1:46 
GeneralRe: Var Wars Pin
Slacker00722-Jul-19 1:50
professionalSlacker00722-Jul-19 1:50 
GeneralRe: Var Wars Pin
OriginalGriff22-Jul-19 3:02
mveOriginalGriff22-Jul-19 3:02 
GeneralRe: Var Wars Pin
Matt McGuire24-Jul-19 5:05
professionalMatt McGuire24-Jul-19 5:05 
GeneralRe: Var Wars Pin
  Forogar  22-Jul-19 3:11
professional  Forogar  22-Jul-19 3:11 
I love "var". I use when writing a declaration for the first time and then see what the actual type is, using intellisense, and change it to that. It makes working out what some of the more obscure method calls actually return a lot easier.
- I would love to change the world, but they won’t give me the source code.

GeneralRe: Var Wars Pin
PeejayAdams22-Jul-19 4:17
PeejayAdams22-Jul-19 4:17 
GeneralRe: Var Wars Pin
obermd23-Jul-19 3:22
obermd23-Jul-19 3:22 
GeneralC# (and C style?) Pin
Slacker00721-Jul-19 23:47
professionalSlacker00721-Jul-19 23:47 
GeneralRe: C# (and C style?) Pin
honey the codewitch22-Jul-19 2:34
mvahoney the codewitch22-Jul-19 2:34 
GeneralRe: C# (and C style?) Pin
Slacker00722-Jul-19 3:05
professionalSlacker00722-Jul-19 3:05 
GeneralRe: C# (and C style?) Pin
honey the codewitch22-Jul-19 5:46
mvahoney the codewitch22-Jul-19 5:46 
GeneralRe: C# (and C style?) Pin
RandMan755723-Jul-19 2:51
RandMan755723-Jul-19 2:51 
GeneralC# Pin
Akhil Mittal21-Jul-19 23:27
professionalAkhil Mittal21-Jul-19 23:27 
GeneralRe: C# Pin
Slacker00721-Jul-19 23:45
professionalSlacker00721-Jul-19 23:45 
Generalshort, neat unambiguous - C Pin
Eek Ten Bears21-Jul-19 22:34
Eek Ten Bears21-Jul-19 22:34 
GeneralGods be blessed Pin
den2k8821-Jul-19 21:32
professionalden2k8821-Jul-19 21:32 
Generalpublic int Count {get; private set;} Pin
OriginalGriff21-Jul-19 20:22
mveOriginalGriff21-Jul-19 20:22 
GeneralWell c-style wins because c# is #1 PinPopular
Mike (Prof. Chuck)21-Jul-19 19:55
professionalMike (Prof. Chuck)21-Jul-19 19:55 
GeneralRe: Well c-style wins because c# is #1 Pin
OriginalGriff21-Jul-19 20:23
mveOriginalGriff21-Jul-19 20:23 
GeneralRe: Well c-style wins because c# is #1 Pin
  Forogar  22-Jul-19 3:09
professional  Forogar  22-Jul-19 3:09 
GeneralRe: Well c-style wins because c# is #1 Pin
Mike (Prof. Chuck)22-Jul-19 3:14
professionalMike (Prof. Chuck)22-Jul-19 3:14 
GeneralRe: Well c-style wins because c# is #1 Pin
OriginalGriff22-Jul-19 3:27
mveOriginalGriff22-Jul-19 3:27 

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.