Click here to Skip to main content
15,886,919 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Thought of the Day Pin
rnbergren23-Jun-20 5:50
rnbergren23-Jun-20 5:50 
GeneralRe: Thought of the Day Pin
RedDk23-Jun-20 7:00
RedDk23-Jun-20 7:00 
GeneralRe: Thought of the Day Pin
dandy7223-Jun-20 7:20
dandy7223-Jun-20 7:20 
GeneralRe: Thought of the Day Pin
DerekT-P24-Jun-20 6:47
professionalDerekT-P24-Jun-20 6:47 
Questionc# var PinPopular
ZurdoDev23-Jun-20 3:10
professionalZurdoDev23-Jun-20 3:10 
AnswerRe: c# var PinPopular
F-ES Sitecore23-Jun-20 3:20
professionalF-ES Sitecore23-Jun-20 3:20 
GeneralRe: c# var Pin
megaadam23-Jun-20 5:12
professionalmegaadam23-Jun-20 5:12 
AnswerRe: c# var PinPopular
Greg Utas23-Jun-20 3:21
professionalGreg Utas23-Jun-20 3:21 
I use auto, the C++ equivalent, whenever it will deduce the correct type.
  • It forces you to initialize the variable.
  • If the variable is initialized by calling a function, and that function's return type changes, the code might not even be affected.
  • Some type names are long or complicated, and I hate spilling lines.
Some argue that it makes the code harder to understand because the reader has to figure out the type. My counterargument is that the reader doesn't understand how the code fits into the system if this is the case.

GeneralRe: c# var Pin
Mircea Neacsu23-Jun-20 9:25
Mircea Neacsu23-Jun-20 9:25 
GeneralRe: c# var Pin
Greg Utas23-Jun-20 9:38
professionalGreg Utas23-Jun-20 9:38 
AnswerRe: c# var Pin
GuyThiebaut23-Jun-20 3:21
professionalGuyThiebaut23-Jun-20 3:21 
GeneralRe: c# var Pin
obermd23-Jun-20 4:15
obermd23-Jun-20 4:15 
GeneralRe: c# var Pin
GuyThiebaut23-Jun-20 4:39
professionalGuyThiebaut23-Jun-20 4:39 
GeneralRe: c# var Pin
BillWoodruff24-Jun-20 0:48
professionalBillWoodruff24-Jun-20 0:48 
GeneralRe: c# var Pin
GuyThiebaut24-Jun-20 2:34
professionalGuyThiebaut24-Jun-20 2:34 
AnswerRe: c# var PinPopular
Marc Clifton23-Jun-20 3:21
mvaMarc Clifton23-Jun-20 3:21 
GeneralRe: c# var Pin
ZurdoDev23-Jun-20 3:29
professionalZurdoDev23-Jun-20 3:29 
GeneralRe: c# var PinPopular
OriginalGriff23-Jun-20 3:41
mveOriginalGriff23-Jun-20 3:41 
GeneralRe: c# var Pin
obermd23-Jun-20 4:18
obermd23-Jun-20 4:18 
GeneralRe: c# var Pin
Richard Deeming23-Jun-20 4:51
mveRichard Deeming23-Jun-20 4:51 
GeneralRe: c# var Pin
OriginalGriff23-Jun-20 4:59
mveOriginalGriff23-Jun-20 4:59 
GeneralRe: c# var Pin
Nelek23-Jun-20 5:25
protectorNelek23-Jun-20 5:25 
GeneralRe: c# var Pin
Marc Clifton23-Jun-20 5:25
mvaMarc Clifton23-Jun-20 5:25 
GeneralRe: c# var Pin
BillWoodruff24-Jun-20 0:52
professionalBillWoodruff24-Jun-20 0:52 
GeneralRe: c# var Pin
pkfox23-Jun-20 20:46
professionalpkfox23-Jun-20 20:46 

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.