Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
Kevin Bewley29-Apr-13 0:30
Kevin Bewley29-Apr-13 0:30 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
harold aptroot29-Apr-13 0:38
harold aptroot29-Apr-13 0:38 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
Kevin Bewley29-Apr-13 0:40
Kevin Bewley29-Apr-13 0:40 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
harold aptroot29-Apr-13 0:43
harold aptroot29-Apr-13 0:43 
GeneralRe: Incrementing and Decrementing - Just Trying to Understand Pin
N8tiv5-May-13 0:29
N8tiv5-May-13 0:29 
Questionwhy you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
BillWoodruff27-Apr-13 18:33
professionalBillWoodruff27-Apr-13 18:33 
AnswerRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
SledgeHammer0127-Apr-13 18:54
SledgeHammer0127-Apr-13 18:54 
GeneralRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
BillWoodruff27-Apr-13 19:41
professionalBillWoodruff27-Apr-13 19:41 
Thanks for your response, SledgeHammer01,

I've revised the section about which you commented, "I don't get it... this works just fine," in a way where I hope my sense of the weirdness of getting a passed in Func to evaluate is clearer.

I have no problem at all with the use of 'var as a way to save repetitious entry of complex object Types on "both sides" of an assignment statement: MS's documentation clearly tells you that is one of two primary uses 'var is for. The other use, of course, is to conveniently hold complex "unknown" Types returned by, for example, a Linq operation.

What I think is "bad practice," with using 'var, is to create a variable name that's not mnemonic, that doesn't "shout" at you, wherever you are in the code, what kind of object it contains, and/or how it's used, but you could say that about any variable name, imho.

Your example of "changing a method's signature" in a lambda used as an EventHandler is interesting, but I don't really see how you are in any way changing the signature of any method. In my view you are just inserting a call to another Method in the executable code body of the EventHandler. Perhaps if I saw your code that creates 'MyEventHandler, I'd "get" what you're demonstrating.

yours, Bill

Humans are amphibians: half spirit, half animal; as spirits they belong to the eternal world; as animals they inhabit time. While their spirit can be directed to an eternal object, their bodies, passions, and imagination are in continual change, for to be in time, means to change. Their nearest approach to constancy is undulation: repeated return to a level from which they repeatedly fall back, a series of troughs and peaks.” C.S. Lewis

GeneralRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
SledgeHammer0127-Apr-13 20:07
SledgeHammer0127-Apr-13 20:07 
AnswerRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
Richard Deeming29-Apr-13 2:19
mveRichard Deeming29-Apr-13 2:19 
GeneralRe: why you can't store a lambda expression in a 'dynamic variable, or 'var variable ? Pin
BillWoodruff29-Apr-13 14:07
professionalBillWoodruff29-Apr-13 14:07 
QuestionExtract Date part and pass only Date Pin
meeram3927-Apr-13 4:24
professionalmeeram3927-Apr-13 4:24 
AnswerRe: Extract Date part and pass only Date Pin
Dave Kreskowiak27-Apr-13 5:31
mveDave Kreskowiak27-Apr-13 5:31 
AnswerRe: Extract Date part and pass only Date Pin
jschell27-Apr-13 11:15
jschell27-Apr-13 11:15 
GeneralJogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Member 1000184526-Apr-13 13:15
Member 1000184526-Apr-13 13:15 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
dusty_dex26-Apr-13 13:36
dusty_dex26-Apr-13 13:36 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Member 1000184526-Apr-13 15:30
Member 1000184526-Apr-13 15:30 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Dave Kreskowiak26-Apr-13 17:16
mveDave Kreskowiak26-Apr-13 17:16 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Member 1000184526-Apr-13 23:54
Member 1000184526-Apr-13 23:54 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Dave Kreskowiak27-Apr-13 4:09
mveDave Kreskowiak27-Apr-13 4:09 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Richard MacCutchan26-Apr-13 22:25
mveRichard MacCutchan26-Apr-13 22:25 
GeneralRe: Jogar uma imagem em um picturibox, apartir de um clique em uma linha do datagridview Pin
Member 1000184526-Apr-13 23:45
Member 1000184526-Apr-13 23:45 
QuestionData in XmlFiles or in Database Pin
Frygreen26-Apr-13 7:42
Frygreen26-Apr-13 7:42 
AnswerRe: Data in XmlFiles or in Database Pin
Dave Kreskowiak26-Apr-13 7:52
mveDave Kreskowiak26-Apr-13 7:52 
GeneralRe: Data in XmlFiles or in Database Pin
Frygreen26-Apr-13 8:08
Frygreen26-Apr-13 8:08 

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.