Click here to Skip to main content
15,895,746 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
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 
GeneralRe: Using IEnumerable nonsense for everything Pin
Jono Stewart18-Jul-16 20:30
Jono Stewart18-Jul-16 20:30 
GeneralRe: Using IEnumerable nonsense for everything Pin
Clifford Nelson16-Jul-16 18:31
Clifford Nelson16-Jul-16 18:31 
GeneralRe: Using IEnumerable nonsense for everything Pin
Sander Rossel17-Jul-16 0:01
professionalSander Rossel17-Jul-16 0:01 
Nope, I love that style of programming.
It's SO much more readable than a foreach/for/while loop.
It becomes immediately clear what the code does.
There's some collection than we need to filter, transform and process whereas a loop is just a loop and might do all those things, but you won't know until you read through the loop, probably with a lot more code to keep the new lists and counters. I've found a lot more unreadable loops than LINQ queries. I have no idea why you'd find it unreadable, it reads almost like natural language... Unsure | :~
Anyway, that style is necessary for LINQ to SQL/Entities (because loops can't build expression trees, convert that to SQL and be lazy evaluated). And if I had to choose between LINQ or plain old SQL I'd choose LINQ wherever possible.

Only the .ForEach() is an odd one. It's defined on List<t> and not as a LINQ extension method because ForEach, by definition, has side-effects and LINQ was designed keeping the functional paradigm in mind. I never use it.
Read my (free) ebook Object-Oriented Programming in C# Succinctly.
Visit my blog at Sander's bits - Writing the code you need.
Or read my articles here on CodeProject.
Simplicity is prerequisite for reliability.
— Edsger W. Dijkstra
Regards,
Sander

GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot17-Jul-16 1:35
harold aptroot17-Jul-16 1:35 
GeneralRe: Using IEnumerable nonsense for everything Pin
Sander Rossel17-Jul-16 21:19
professionalSander Rossel17-Jul-16 21:19 
GeneralRe: Using IEnumerable nonsense for everything Pin
Gaston Verelst17-Jul-16 21:19
Gaston Verelst17-Jul-16 21:19 
GeneralRe: Using IEnumerable nonsense for everything Pin
Sander Rossel17-Jul-16 21:22
professionalSander Rossel17-Jul-16 21:22 
GeneralRe: Using IEnumerable nonsense for everything Pin
Mladen Janković17-Jul-16 0:13
Mladen Janković17-Jul-16 0:13 
GeneralRe: Using IEnumerable nonsense for everything Pin
Mark_Wallace17-Jul-16 10:30
Mark_Wallace17-Jul-16 10:30 
GeneralRe: Using IEnumerable nonsense for everything Pin
Yet Another XCoder17-Jul-16 20:29
Yet Another XCoder17-Jul-16 20:29 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot18-Jul-16 0:51
harold aptroot18-Jul-16 0:51 
GeneralRe: Using IEnumerable nonsense for everything Pin
irneb17-Jul-16 20:42
irneb17-Jul-16 20:42 
GeneralRe: Using IEnumerable nonsense for everything Pin
Sentenryu18-Jul-16 0:18
Sentenryu18-Jul-16 0:18 
GeneralRe: Using IEnumerable nonsense for everything Pin
irneb18-Jul-16 9:36
irneb18-Jul-16 9:36 
GeneralRe: Using IEnumerable nonsense for everything Pin
irneb18-Jul-16 9:51
irneb18-Jul-16 9:51 
GeneralRe: Using IEnumerable nonsense for everything Pin
HerrGilbert17-Jul-16 20:48
professionalHerrGilbert17-Jul-16 20:48 
GeneralRe: Using IEnumerable nonsense for everything Pin
harold aptroot18-Jul-16 0:53
harold aptroot18-Jul-16 0:53 
GeneralRe: Using IEnumerable nonsense for everything Pin
Aunebakk17-Jul-16 22:49
Aunebakk17-Jul-16 22:49 
GeneralRe: Using IEnumerable nonsense for everything Pin
maze318-Jul-16 2:18
professionalmaze318-Jul-16 2:18 
GeneralRe: Using IEnumerable nonsense for everything Pin
Jeroen_R18-Jul-16 3:38
Jeroen_R18-Jul-16 3:38 

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.