7 comments

[ 4.6 ms ] story [ 30.6 ms ] thread
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!

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.)

That's a good point, thank you! I will add a new section for this later today.
> The only acceptable for loop is the one that has only one statement in it's body and does not need curly braces.

What?!

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.
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.
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?