Click here to Skip to main content
15,897,891 members

Survey Results

Do you use full variable names in trivial lambda expressions?

Survey period: 24 Aug 2015 to 31 Aug 2015

eg "Items.Select(x => x.Id)" vs "Items.Select(product => product.ID)". Are you brief or expressive?

OptionVotes% 
I tend to use short (eg single letter) variable names in throw-away lambda expressions.54039.16
It depends on the context or complexity of the lambda40429.30
I tend to use full variable names for lambda expressions21315.45
I don't use lambda expressions22216.10



 
GeneralRe: All code should pass the 3 and 10 test Pin
Nelek29-Aug-15 7:36
protectorNelek29-Aug-15 7:36 
GeneralRe: All code should pass the 3 and 10 test Pin
Paul Conrad29-Aug-15 8:41
professionalPaul Conrad29-Aug-15 8:41 
GeneralRe: All code should pass the 3 and 10 test Pin
Pualee24-Aug-15 8:28
Pualee24-Aug-15 8:28 
GeneralRe: All code should pass the 3 and 10 test Pin
Duncan Edwards Jones24-Aug-15 8:33
professionalDuncan Edwards Jones24-Aug-15 8:33 
GeneralWhy stop at anonymous lambda's? Pin
Sander Rossel23-Aug-15 22:40
professionalSander Rossel23-Aug-15 22:40 
GeneralRe: Why stop at anonymous lambda's? Pin
OriginalGriff23-Aug-15 23:07
mveOriginalGriff23-Aug-15 23:07 
GeneralRe: Why stop at anonymous lambda's? Pin
Kevin McFarlane25-Aug-15 3:02
Kevin McFarlane25-Aug-15 3:02 
GeneralRe: Why stop at anonymous lambda's? Pin
Rob Grainger26-Aug-15 22:26
Rob Grainger26-Aug-15 22:26 
Well spotted, but the response does indicate that somehow they are allowing for complex trivial lambdas, or is that trivially complex lambda's.

In the example given in the question, I would definitely go with Items.Select(product => product.ID), as the collection's name (Items) does not imply to me that the collection contains products.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: Why stop at anonymous lambda's? Pin
Kevin McFarlane26-Aug-15 23:43
Kevin McFarlane26-Aug-15 23:43 
GeneralRe: Why stop at anonymous lambda's? Pin
Nicholas Marty27-Aug-15 1:02
professionalNicholas Marty27-Aug-15 1:02 
GeneralRe: Why stop at anonymous lambda's? Pin
W Balboos, GHB24-Aug-15 3:27
W Balboos, GHB24-Aug-15 3:27 
GeneralRe: Why stop at anonymous lambda's? Pin
Sander Rossel24-Aug-15 3:32
professionalSander Rossel24-Aug-15 3:32 

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.