Click here to Skip to main content
15,891,316 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: LINQ "let" Pin
Sander Rossel9-Jun-16 3:43
professionalSander Rossel9-Jun-16 3:43 
GeneralRe: LINQ "let" Pin
Nicholas Marty9-Jun-16 4:40
professionalNicholas Marty9-Jun-16 4:40 
GeneralRe: LINQ "let" Pin
James Curran9-Jun-16 4:18
James Curran9-Jun-16 4:18 
GeneralRe: LINQ "let" Pin
Marc Clifton8-Jun-16 7:57
mvaMarc Clifton8-Jun-16 7:57 
GeneralRe: LINQ "let" Pin
Nish Nishant8-Jun-16 10:02
sitebuilderNish Nishant8-Jun-16 10:02 
GeneralRe: LINQ "let" Pin
Kenneth Haugland8-Jun-16 4:45
mvaKenneth Haugland8-Jun-16 4:45 
GeneralRe: LINQ "let" Pin
Sander Rossel8-Jun-16 5:44
professionalSander Rossel8-Jun-16 5:44 
GeneralRe: LINQ "let" Pin
BillWoodruff8-Jun-16 8:29
professionalBillWoodruff8-Jun-16 8:29 
Hi Marc,

I first became aware of the 'Let and 'Into Linq operators through this 2011 CP article (which I down-voted for "lack of original content"): [^]. I have never used them Smile | :) because I have never invested the energy to learn to use the "fuller" query syntax (my bad).

Your comment makes me wonder what I am missing (other than motivation).

cheers, Bill

p.s. the Microsoft example of 'Let you cite imho goes to a lot trouble do this:

C#
string[] strings = 
{
    "A penny saved is a penny earned.",
    "The early bird catches the worm.",
    "The pen is mightier than the sword." 
};

string vowels = "aeiou";

List<string> vowelstartwords = String.Join(" ", strings)
        .Split(' ')
        .Distinct()
        .Where(word => vowels.Contains(Char.ToLower(word[0])))
        .ToList();
That example, taken as a programming challenge, interests me: it leaves me wondering if it could be significantly improved in terms of memory use and execution time, and if the Linq code using 'Let would, in fact, improve those usage parameters.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008


modified 8-Jun-16 14:41pm.

GeneralRe: LINQ "let" Pin
Richard Deeming8-Jun-16 8:52
mveRichard Deeming8-Jun-16 8:52 
GeneralRe: LINQ "let" Pin
BillWoodruff8-Jun-16 12:46
professionalBillWoodruff8-Jun-16 12:46 
GeneralRe: LINQ "let" Pin
Mark Whybird8-Jun-16 21:24
Mark Whybird8-Jun-16 21:24 
GeneralRe: LINQ "let" Pin
Richard Deeming9-Jun-16 1:38
mveRichard Deeming9-Jun-16 1:38 
GeneralRe: LINQ "let" Pin
Nicholas Marty9-Jun-16 2:54
professionalNicholas Marty9-Jun-16 2:54 
GeneralRe: LINQ "let" Pin
Mark Whybird9-Jun-16 13:41
Mark Whybird9-Jun-16 13:41 
GeneralRe: LINQ "let" Pin
Mark Whybird9-Jun-16 13:40
Mark Whybird9-Jun-16 13:40 
AnswerRe: LINQ "let" Pin
Nish Nishant8-Jun-16 10:01
sitebuilderNish Nishant8-Jun-16 10:01 
GeneralRe: LINQ "let" Pin
Super Lloyd8-Jun-16 14:55
Super Lloyd8-Jun-16 14:55 
GeneralRe: LINQ "let" Pin
louthy9-Jun-16 10:38
louthy9-Jun-16 10:38 
NewsOverdosing on anti-diarrhea drugs: Only in America Pin
Cornelius Henning8-Jun-16 2:57
professionalCornelius Henning8-Jun-16 2:57 
GeneralRe: Overdosing on anti-diarrhea drugs: Only in America Pin
Mike Hankey8-Jun-16 3:04
mveMike Hankey8-Jun-16 3:04 
GeneralRe: Overdosing on anti-diarrhea drugs: Only in America Pin
phil.o8-Jun-16 3:18
professionalphil.o8-Jun-16 3:18 
GeneralRe: Overdosing on anti-diarrhea drugs: Only in America Pin
W Balboos, GHB8-Jun-16 3:09
W Balboos, GHB8-Jun-16 3:09 
GeneralRe: Overdosing on anti-diarrhea drugs: Only in America Pin
Daniel Pfeffer8-Jun-16 3:13
professionalDaniel Pfeffer8-Jun-16 3:13 
GeneralRe: Overdosing on anti-diarrhea drugs: Only in America Pin
W Balboos, GHB8-Jun-16 3:15
W Balboos, GHB8-Jun-16 3:15 
GeneralRe: Overdosing on anti-diarrhea drugs: Only in America Pin
Richard Deeming8-Jun-16 3:26
mveRichard Deeming8-Jun-16 3:26 

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.