Click here to Skip to main content
15,894,124 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
Nish Nishant18-Jul-16 4:24
sitebuilderNish Nishant18-Jul-16 4:24 
GeneralRe: Using IEnumerable nonsense for everything Pin
Mladen Janković17-Jul-16 0:24
Mladen Janković17-Jul-16 0:24 
GeneralRe: Using IEnumerable nonsense for everything Pin
PIEBALDconsult17-Jul-16 6:39
mvePIEBALDconsult17-Jul-16 6:39 
GeneralRe: Using IEnumerable nonsense for everything Pin
obermd18-Jul-16 15:04
obermd18-Jul-16 15:04 
GeneralRe: Using IEnumerable nonsense for everything Pin
Mladen Janković18-Jul-16 15:57
Mladen Janković18-Jul-16 15:57 
GeneralRe: Using IEnumerable nonsense for everything Pin
Richard Deeming18-Jul-16 3:11
mveRichard Deeming18-Jul-16 3:11 
GeneralRe: Using IEnumerable nonsense for everything Pin
PIEBALDconsult18-Jul-16 3:28
mvePIEBALDconsult18-Jul-16 3:28 
GeneralRe: Using IEnumerable nonsense for everything Pin
MiddleTommy18-Jul-16 6:47
MiddleTommy18-Jul-16 6:47 
I would argue the total opposite. This is not cancer. The data does not get copied and iterated because this is all lazy processed. Perhaps you dont understand how these methods actually work.
Do you know how many times it took me hours to construct a proper nested for loop? With this style the complex can be accomplished in minutes.

You need to call ToList when you are complete to finally iterate over the entire IEnumerable. Because the Where and Select methods are lazy processed I have found that you dont get the proper results at the end unless you call ToList.

Also calling ToList is needed when performing async or multi threaded code. You need your own copy of the items to mess with otherwise you will get errors.

As for performance we are talking small milliseconds longer.

I can read and understand that one liner perfectly in 5 seconds. Can you honestly say that a for loop is perfectly understandable in that amount of time? I think not.

Also did you know you can iterate over thousands of records in the same amount of time it takes to do an if(x == y) statement. "if" comparisons are the slowest code to run.
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot18-Jul-16 8:50
harold aptroot18-Jul-16 8:50 
GeneralRe: Using IEnumerable nonsense for everything Pin
F-ES Sitecore16-Jul-16 5:54
professionalF-ES Sitecore16-Jul-16 5:54 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot16-Jul-16 5:58
harold aptroot16-Jul-16 5:58 
GeneralRe: Using IEnumerable nonsense for everything Pin
Mladen Janković17-Jul-16 0:45
Mladen Janković17-Jul-16 0:45 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot17-Jul-16 1:25
harold aptroot17-Jul-16 1:25 
GeneralRe: Using IEnumerable nonsense for everything Pin
jfren48418-Jul-16 3:20
jfren48418-Jul-16 3:20 
GeneralRe: Using IEnumerable nonsense for everything Pin
Brisingr Aerowing16-Jul-16 16:43
professionalBrisingr Aerowing16-Jul-16 16:43 
GeneralRe: Using IEnumerable nonsense for everything Pin
Dan Neely18-Jul-16 3:12
Dan Neely18-Jul-16 3:12 
GeneralRe: Using IEnumerable nonsense for everything Pin
jfren48418-Jul-16 3:23
jfren48418-Jul-16 3:23 
GeneralRe: Using IEnumerable nonsense for everything Pin
jfren48418-Jul-16 3:26
jfren48418-Jul-16 3:26 
GeneralRe: Using IEnumerable nonsense for everything Pin
patbob18-Jul-16 8:49
patbob18-Jul-16 8:49 
GeneralRe: Using IEnumerable nonsense for everything Pin
Maarten197718-Jul-16 3:32
Maarten197718-Jul-16 3:32 
GeneralRe: Using IEnumerable nonsense for everything Pin
Clifford Nelson16-Jul-16 18:40
Clifford Nelson16-Jul-16 18:40 
GeneralRe: Using IEnumerable nonsense for everything Pin
F-ES Sitecore17-Jul-16 2:40
professionalF-ES Sitecore17-Jul-16 2:40 
GeneralRe: Using IEnumerable nonsense for everything Pin
Richard Deeming18-Jul-16 3:23
mveRichard Deeming18-Jul-16 3:23 
GeneralRe: Using IEnumerable nonsense for everything Pin
F-ES Sitecore18-Jul-16 3:35
professionalF-ES Sitecore18-Jul-16 3:35 
GeneralRe: Using IEnumerable nonsense for everything Pin
Richard Deeming18-Jul-16 3:44
mveRichard Deeming18-Jul-16 3:44 

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.