Click here to Skip to main content
15,915,086 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.

 
GeneralMy laptop so slow that... Pin
Stephen Gonzalez25-Oct-16 8:59
Stephen Gonzalez25-Oct-16 8:59 
GeneralRe: My laptop so slow that... Pin
Slacker00725-Oct-16 9:26
professionalSlacker00725-Oct-16 9:26 
GeneralI think I've just been sent The Pink Panther's "To Do" list. Pin
OriginalGriff25-Oct-16 8:12
mveOriginalGriff25-Oct-16 8:12 
GeneralRe: I think I've just been sent The Pink Panther's "To Do" list. Pin
Marc Clifton25-Oct-16 8:19
mvaMarc Clifton25-Oct-16 8:19 
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 
[disclaimer] OK, this is probably a totally lame post. [/disclaimer]

When you use var (or even if you just embed the rvalue as a parameter to another method), you don't need to reference the assembly containing the type.

var prop = rec.GetType().GetProperty(propName);

Doesn't require using System.Reflection;

And Intellisense works just fine. But this:

PropertyInfo prop = rec.GetType().GetProperty(propName);

Does.

Neither does this:

object val = Converter.Convert(data, rec.GetType().GetProperty(propName).PropertyType);

I find that, well, interesting.

(I'm using VS2015, lest anyone even care.)

Marc
Imperative to Functional Programming Succinctly

Contributors Wanted for Higher Order Programming Project!

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

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 
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 

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.