Click here to Skip to main content
15,910,123 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: I think I've just been sent The Pink Panther's "To Do" list. Pin
OriginalGriff25-Oct-16 8:30
mveOriginalGriff25-Oct-16 8:30 
GeneralRe: I think I've just been sent The Pink Panther's "To Do" list. Pin
Colin Mullikin25-Oct-16 9:03
professionalColin Mullikin25-Oct-16 9:03 
GeneralRe: I think I've just been sent The Pink Panther's "To Do" list. Pin
PIEBALDconsult25-Oct-16 11:43
mvePIEBALDconsult25-Oct-16 11:43 
GeneralAn interesting (or not) thing about C#'s var Pin
Marc Clifton25-Oct-16 7:33
mvaMarc Clifton25-Oct-16 7:33 
GeneralMessage Removed PinPopular
25-Oct-16 8:03
professionalN_tro_P25-Oct-16 8:03 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Marc Clifton25-Oct-16 8:17
mvaMarc Clifton25-Oct-16 8:17 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Eddy Vluggen25-Oct-16 9:23
professionalEddy Vluggen25-Oct-16 9:23 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Dan Neely25-Oct-16 10:08
Dan Neely25-Oct-16 10:08 
Eddy Vluggen wrote:
Simple case against that reasoning; var does not just hide the type, it accepts every type - and that might change, without going noticed when using var. When you specify which interface you are using you don't run into that problem.


Yup, although much of the time when you change the type you do end up getting breakage that needs fixed to compile anyway.

Like Marc, storing the dumpster fires that linq often returns as temporary/local/ephemeral variables (if I want to persist it I force it into something non-retarded) is one of the two places I normally use var.

The other is when declaring my own dumpster fire generics because in these cases the type information is already explicitly given 10 or 30 characters to the right..
C#
var whyGodWhy = new Dictionary<string, tuple<int, List<myType>>>();
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius

Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt

GeneralRe: An interesting (or not) thing about C#'s var Pin
Eddy Vluggen25-Oct-16 10:16
professionalEddy Vluggen25-Oct-16 10:16 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Dan Neely25-Oct-16 10:21
Dan Neely25-Oct-16 10:21 
GeneralMessage Removed Pin
25-Oct-16 11:00
professionalN_tro_P25-Oct-16 11:00 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Eddy Vluggen25-Oct-16 11:19
professionalEddy Vluggen25-Oct-16 11:19 
GeneralMessage Removed Pin
25-Oct-16 11:31
professionalN_tro_P25-Oct-16 11:31 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Eddy Vluggen25-Oct-16 11:41
professionalEddy Vluggen25-Oct-16 11:41 
GeneralMessage Removed Pin
25-Oct-16 11:57
professionalN_tro_P25-Oct-16 11:57 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Eddy Vluggen26-Oct-16 2:57
professionalEddy Vluggen26-Oct-16 2:57 
GeneralMessage Removed Pin
26-Oct-16 3:24
professionalN_tro_P26-Oct-16 3:24 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Eddy Vluggen26-Oct-16 3:56
professionalEddy Vluggen26-Oct-16 3:56 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Sander Rossel25-Oct-16 10:39
professionalSander Rossel25-Oct-16 10:39 
GeneralMessage Removed Pin
25-Oct-16 11:03
professionalN_tro_P25-Oct-16 11:03 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Sander Rossel25-Oct-16 11:43
professionalSander Rossel25-Oct-16 11:43 
GeneralMessage Removed Pin
25-Oct-16 12:08
professionalN_tro_P25-Oct-16 12:08 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Sander Rossel25-Oct-16 12:26
professionalSander Rossel25-Oct-16 12:26 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Jeremy Falcon26-Oct-16 8:43
professionalJeremy Falcon26-Oct-16 8:43 
GeneralRe: An interesting (or not) thing about C#'s var Pin
Sander Rossel26-Oct-16 8:46
professionalSander Rossel26-Oct-16 8: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.