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



 
GeneralOf course the C++ moh-dern-ist Pin
Dean Roddey28-Jul-19 2:49
Dean Roddey28-Jul-19 2:49 
Generalnot picky Pin
Matt McGuire24-Jul-19 5:20
professionalMatt McGuire24-Jul-19 5:20 
GeneralThe result indirectly tells that people are more comfortable in C/C# type language Pin
Anurag Gandhi23-Jul-19 7:01
professionalAnurag Gandhi23-Jul-19 7:01 
GeneralCan we give anything to old BASIC? Pin
bryanren23-Jul-19 6:08
bryanren23-Jul-19 6:08 
GeneralRe: Can we give anything to old BASIC? Pin
OriginalGriff24-Jul-19 10:07
mveOriginalGriff24-Jul-19 10:07 
GeneralRe: Can we give anything to old BASIC? Pin
bryanren24-Jul-19 13:38
bryanren24-Jul-19 13:38 
GeneralRe: Can we give anything to old BASIC? Pin
OriginalGriff24-Jul-19 19:09
mveOriginalGriff24-Jul-19 19:09 
Generalwhy was C# left out ? Pin
BillWoodruff23-Jul-19 4:16
professionalBillWoodruff23-Jul-19 4:16 
GeneralAny option with strict typing Pin
obermd23-Jul-19 3:20
obermd23-Jul-19 3:20 
GeneralAnother Missing Option Pin
Slow Eddie23-Jul-19 3:20
professionalSlow Eddie23-Jul-19 3:20 
GeneralRe: Another Missing Option Pin
Chris Maunder23-Jul-19 3:41
cofounderChris Maunder23-Jul-19 3:41 
GeneralRe: Another Missing Option Pin
Kirk 1038982123-Jul-19 4:20
Kirk 1038982123-Jul-19 4:20 
GeneralRe: Another Missing Option Pin
Slow Eddie23-Jul-19 5:59
professionalSlow Eddie23-Jul-19 5:59 
GeneralRe: Another Missing Option Pin
raddevus24-Jul-19 7:58
mvaraddevus24-Jul-19 7:58 
I've been switching Android over to Kotlin and it uses that new syntax (as does Swift) like TypeScript and I've been stumbling around with it too.
It really looks odd to me when you initialize the var in these languages bec it looks like you are setting the type to a value.
Kotlin
var thing : String = "this is the thing"


I sat down and really tried to think about why the new languages made this change. It seems far more cryptic than the old way. I think I had decided on one reason why they'd done it and then I forgot again.

Oh, now I remember what I thought it might be:
They are moving toward dynamically typed languages (of course, laziness rules today Roll eyes | :rolleyes: ) so now when you leave the type off you'll just have:
Kotlin
var [name] = Thing; // auto-typed

So this is probably some middle-ground syntax and the middle-ground is always weak!! Laugh | :laugh:
GeneralI'm not fussed Pin
MarkTJohnson23-Jul-19 2:52
professionalMarkTJohnson23-Jul-19 2:52 
GeneralRe: I'm not fussed Pin
raddevus24-Jul-19 7:52
mvaraddevus24-Jul-19 7:52 
GeneralMissing option Pin
Gary Wheeler23-Jul-19 1:34
Gary Wheeler23-Jul-19 1:34 
GeneralLife is no longer so simple Pin
Marc Clifton22-Jul-19 7:53
mvaMarc Clifton22-Jul-19 7:53 
GeneralRe: Life is no longer so simple Pin
Slacker00722-Jul-19 10:25
professionalSlacker00722-Jul-19 10:25 
GeneralYou missed C# inferred style. Pin
nmarcel22-Jul-19 3:10
nmarcel22-Jul-19 3:10 
GeneralRe: You missed C# inferred style. PinPopular
PeejayAdams22-Jul-19 4:42
PeejayAdams22-Jul-19 4:42 
GeneralRe: You missed C# inferred style. Pin
Scott Serl22-Jul-19 9:21
Scott Serl22-Jul-19 9:21 
GeneralRe: You missed C# inferred style. Pin
OriginalGriff22-Jul-19 9:29
mveOriginalGriff22-Jul-19 9:29 
GeneralRe: You missed C# inferred style. Pin
Slacker00722-Jul-19 10:24
professionalSlacker00722-Jul-19 10:24 
GeneralRe: You missed C# inferred style. (C# is essenially C++ as far as BNF concerned) Pin
steveb27-Jul-19 3:41
mvesteveb27-Jul-19 3:41 

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.