Click here to Skip to main content
15,900,461 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: Using IEnumerable nonsense for everything Pin
Herbie Mountjoy18-Jul-16 1:49
professionalHerbie Mountjoy18-Jul-16 1:49 
GeneralRe: Using IEnumerable nonsense for everything Pin
Rob Grainger19-Jul-16 5:56
Rob Grainger19-Jul-16 5:56 
GeneralRe: Using IEnumerable nonsense for everything Pin
#realJSOP16-Jul-16 6:07
professional#realJSOP16-Jul-16 6:07 
GeneralRe: Using IEnumerable nonsense for everything Pin
BillWoodruff16-Jul-16 6:12
professionalBillWoodruff16-Jul-16 6:12 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot16-Jul-16 6:16
harold aptroot16-Jul-16 6:16 
GeneralRe: Using IEnumerable nonsense for everything Pin
BillWoodruff16-Jul-16 6:20
professionalBillWoodruff16-Jul-16 6:20 
GeneralRe: Using IEnumerable nonsense for everything Pin
Marc Clifton16-Jul-16 14:47
mvaMarc Clifton16-Jul-16 14:47 
GeneralRe: Using IEnumerable nonsense for everything Pin
BillWoodruff16-Jul-16 18:45
professionalBillWoodruff16-Jul-16 18:45 
Marc Clifton wrote:
Which is why I have an extension method to overcome that shortcoming
You and Eric:

Eric Lippert, 2009, op. cit. "A number of people have asked me why there is no Microsoft-provided “ForEach” sequence operator extension method. The List<t> class has such a method already of course, but there’s no reason why such a method could not be created as an extension method for all sequences. It’s practically a one-liner:"
C#
public static void ForEach<T>(this IEnumerable<T> sequence, Action<T> action)
{ 
  // argument null checking omitted
  foreach(T item in sequence) action(item);
}
For me, seems like something happened this year where suddenly I felt more comfortable (secure ?) using Linq goodness, and Yield Return, and IEnumerables of whatever, and writing extension methods that have a "socket" for an Action, or Func. I have seen some students bounce off those semantics/facilities, and some take to it like the proverbial "ducks to water."

And (I hope you can still blush), you were an influence on me to "get more into" the method-chaining style, which I really like, now.

Not that I am "catching up" with you (technically) in any way, though: occasionally I get a glimpse of your shadow going around a corner OMG | :OMG:

thanks for the mentories, Bill
«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

GeneralRe: Using IEnumerable nonsense for everything Pin
Marc Clifton17-Jul-16 3:55
mvaMarc Clifton17-Jul-16 3:55 
GeneralRe: Using IEnumerable nonsense for everything Pin
Jono Stewart18-Jul-16 4:10
Jono Stewart18-Jul-16 4:10 
GeneralRe: Using IEnumerable nonsense for everything Pin
Rob Grainger19-Jul-16 22:21
Rob Grainger19-Jul-16 22:21 
GeneralRe: Using IEnumerable nonsense for everything Pin
jgakenhe16-Jul-16 8:37
professionaljgakenhe16-Jul-16 8:37 
GeneralRe: Using IEnumerable nonsense for everything PinPopular
Sander Rossel17-Jul-16 0:08
professionalSander Rossel17-Jul-16 0:08 
GeneralRe: Using IEnumerable nonsense for everything Pin
Mladen Janković17-Jul-16 0:30
Mladen Janković17-Jul-16 0:30 
GeneralRe: Using IEnumerable nonsense for everything Pin
Rob Grainger19-Jul-16 22:22
Rob Grainger19-Jul-16 22:22 
GeneralRe: Using IEnumerable nonsense for everything PinPopular
Ravi Bhavnani16-Jul-16 9:15
professionalRavi Bhavnani16-Jul-16 9:15 
GeneralRe: Using IEnumerable nonsense for everything Pin
Daniel Pfeffer16-Jul-16 9:39
professionalDaniel Pfeffer16-Jul-16 9:39 
GeneralRe: Using IEnumerable nonsense for everything Pin
Richard Deeming18-Jul-16 3:31
mveRichard Deeming18-Jul-16 3:31 
GeneralRe: Using IEnumerable nonsense for everything PinPopular
Marc Clifton16-Jul-16 14:58
mvaMarc Clifton16-Jul-16 14:58 
GeneralRe: Using IEnumerable nonsense for everything Pin
Sander Rossel17-Jul-16 0:08
professionalSander Rossel17-Jul-16 0:08 
GeneralRe: Using IEnumerable nonsense for everything Pin
Ravi Bhavnani17-Jul-16 3:34
professionalRavi Bhavnani17-Jul-16 3:34 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot17-Jul-16 4:35
harold aptroot17-Jul-16 4:35 
GeneralRe: Using IEnumerable nonsense for everything Pin
BillWoodruff17-Jul-16 6:29
professionalBillWoodruff17-Jul-16 6:29 
GeneralRe: Using IEnumerable nonsense for everything Pin
Marc Clifton17-Jul-16 8:20
mvaMarc Clifton17-Jul-16 8:20 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot17-Jul-16 10:49
harold aptroot17-Jul-16 10:49 

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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   488 votes