
Love LINQ, hate loops (C#) - bertylicious
https://github.com/bert2/love-linq-hate-loops
======
o_nate
Eh.. LINQ statements are fine when you're trying to do fairly straightforward
types of aggregations, but for more customized stuff, I find it more of a pain
to figure out all the syntax than to just use a simple for loop. Newer isn't
always better.

~~~
bertylicious
That's exactly the kind of thinking I'm trying to address. I made a couple
arguments against your position in the summary. Might I ask what specifically
you found to be unconvincing?

------
bertylicious
This is a workshop I prepared for my co-workers to encourage the use of LINQ
over conventional loops in C#.

Any feedback is much appreciated!

~~~
ThrowawayR2
I would suggest mentioning techniques for debugging LINQ, including
breakpointing.

(Personally, I avoid LINQ/Java streams outside of trivial cases precisely
because conventional loops make inserting breakpoints and debugging statements
trivial.)

~~~
bertylicious
That's a good point, thank you! I will add a new section for this later today.

------
eberkund
> The only acceptable for loop is the one that has only one statement in it's
> body and does not need curly braces.

What?!

~~~
bertylicious
Well that statement is a bit absolute. Read it as "the ideal for loop is...".
I think I went overboard when trying to go beyond the usual clean code rules.
I will tone down the wording a bit throughout the whole text.

