Click here to Skip to main content
15,908,115 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: Programmer Competency Matrix Pin
SeattleC++18-Sep-17 5:49
SeattleC++18-Sep-17 5:49 
GeneralRe: Programmer Competency Matrix Pin
Sentenryu19-Sep-17 0:31
Sentenryu19-Sep-17 0:31 
GeneralRe: Programmer Competency Matrix Pin
Member 1156133519-Sep-17 7:24
Member 1156133519-Sep-17 7:24 
GeneralThought of the day Pin
OriginalGriff15-Sep-17 4:54
mveOriginalGriff15-Sep-17 4:54 
GeneralRe: Thought of the day Pin
Mark Parity15-Sep-17 4:59
Mark Parity15-Sep-17 4:59 
GeneralRe: Thought of the day Pin
lopatir15-Sep-17 5:34
lopatir15-Sep-17 5:34 
GeneralRe: Thought of the day Pin
W Balboos, GHB15-Sep-17 6:30
W Balboos, GHB15-Sep-17 6:30 
GeneralEver use this syntax in C# 7? Pin
Marc Clifton15-Sep-17 3:39
mvaMarc Clifton15-Sep-17 3:39 
return _(); IEnumerable<TSource> _() {...}

Found this on MoreLinq, it actually took an SO lookup for me to realize they were use a local method with an "anonymous" name.


In this context, the underscore is just an arbitrary name for a local function (which is a new feature introduced in C# 7.0). If you prefer, you could replace the underscore by a more descriptive name.


Sniff | :^) C# is starting to look more like Ruby/Python.

The explanation is useful though:


By the way, the reason for having two methods here is so that, in case any argument is null, ArgumentNullException will be thrown immediately when DistinctBy is called instead of when the result is enumerated (due to the presence of the yield return statement).


Though, putting this on the same line...I agree with what others wrote. Dead | X|
Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages

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

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

GeneralRe: Ever use this syntax in C# 7? Pin
OriginalGriff15-Sep-17 4:07
mveOriginalGriff15-Sep-17 4:07 
GeneralRe: Ever use this syntax in C# 7? Pin
CodeWraith15-Sep-17 4:37
CodeWraith15-Sep-17 4:37 
GeneralRe: Ever use this syntax in C# 7? Pin
Richard Deeming15-Sep-17 5:22
mveRichard Deeming15-Sep-17 5:22 
GeneralRe: Ever use this syntax in C# 7? Pin
OriginalGriff15-Sep-17 5:33
mveOriginalGriff15-Sep-17 5:33 
GeneralRe: Ever use this syntax in C# 7? Pin
Mladen Janković15-Sep-17 6:06
Mladen Janković15-Sep-17 6:06 
GeneralRe: Ever use this syntax in C# 7? Pin
jschell16-Sep-17 7:02
jschell16-Sep-17 7:02 
GeneralRe: Ever use this syntax in C# 7? Pin
Slacker00715-Sep-17 6:04
professionalSlacker00715-Sep-17 6:04 
GeneralRe: Ever use this syntax in C# 7? Pin
  Forogar  15-Sep-17 7:54
professional  Forogar  15-Sep-17 7:54 
GeneralRe: Ever use this syntax in C# 7? Pin
Slacker00715-Sep-17 8:08
professionalSlacker00715-Sep-17 8:08 
GeneralRe: Ever use this syntax in C# 7? Pin
W Balboos, GHB15-Sep-17 6:36
W Balboos, GHB15-Sep-17 6:36 
GeneralRe: Ever use this syntax in C# 7? Pin
Dave Kreskowiak15-Sep-17 4:23
mveDave Kreskowiak15-Sep-17 4:23 
GeneralRe: Ever use this syntax in C# 7? Pin
TheGreatAndPowerfulOz15-Sep-17 5:19
TheGreatAndPowerfulOz15-Sep-17 5:19 
GeneralRe: Ever use this syntax in C# 7? Pin
Richard Deeming15-Sep-17 5:29
mveRichard Deeming15-Sep-17 5:29 
GeneralRe: Ever use this syntax in C# 7? Pin
Jon McKee15-Sep-17 6:49
professionalJon McKee15-Sep-17 6:49 
GeneralRe: Ever use this syntax in C# 7? Pin
Dave Kreskowiak15-Sep-17 7:28
mveDave Kreskowiak15-Sep-17 7:28 
GeneralRe: Ever use this syntax in C# 7? Pin
R. Giskard Reventlov15-Sep-17 4:50
R. Giskard Reventlov15-Sep-17 4:50 
GeneralRe: Ever use this syntax in C# 7? Pin
lopatir15-Sep-17 6:14
lopatir15-Sep-17 6:14 

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.