3 Improved grammar
source | link

LinqLINQ is primarily designed to allow pure functional queries and transformations on sequences of data (you will notice that all the LINQ operatesextensions take Func delegateddelegates but not Action delegates). Consequently the most common case of a loop that does not fit with linqLINQ very well inis one that is all about non pure-pure functional side effects., e.g.

foreach(var x in list) Console.WriteLine(x);

To get better asat using linq honestlyLINQ, just practice using it.

Every time you are about to write a forfor or foreachforeach loop to do something with a collection, stop, consider if itsit's a good fit for LinqLINQ (i.e. itsit's not just performing an action/side effect on the elements), and if so force your selfyourself to write it using linqLINQ.  

You could also write the foreachforeach version first then rewrite to a linqLINQ version.

As svick points out linq, LINQ should be about making youyour program more readable. It is usually good at this as it tends to emphasisemphasize the intensionintent of the code rather than the mechanism,mechanism; however if you find you cannot make your queries more readable than a simple loop, feel free to stick with the loop.

If you need exercises to practice then, most functional programming list exerciseexercises will map nicely to linqLINQ e.g. 99 problems (especially the first 20 or so) or project euler.

Linq is primarily designed to allow pure functional queries and transformations on sequences of data (you will notice that all the LINQ operates take Func delegated but not Action delegates). Consequently the most common case of a loop that does not fit with linq well in one that is all about non pure functional side effects. e.g.

foreach(var x in list) Console.WriteLine(x);

To get better as using linq honestly, just practice using it.

Every time you are about to write a for or foreach loop to do something with a collection stop, consider if its a good fit for Linq (i.e. its not just performing an action/side effect on the elements) and if so force your self to write it using linq.  

You could also write the foreach version first then rewrite to a linq version.

As svick points out linq should be about making you program more readable. It is usually good at this as it tends to emphasis the intension of the code rather than the mechanism, however if you find you cannot make your queries more readable than a simple loop feel free to stick with the loop.

If you need exercises to practice then most functional programming list exercise will map nicely to linq e.g. 99 problems (especially the first 20 or so) or project euler

LINQ is primarily designed to allow pure functional queries and transformations on sequences of data (you will notice that all the LINQ extensions take Func delegates but not Action delegates). Consequently the most common case of a loop that does not fit with LINQ very well is one that is all about non-pure functional side effects, e.g.

foreach(var x in list) Console.WriteLine(x);

To get better at using LINQ, just practice using it.

Every time you are about to write a for or foreach loop to do something with a collection, stop, consider if it's a good fit for LINQ (i.e. it's not just performing an action/side effect on the elements), and if so force yourself to write it using LINQ.

You could also write the foreach version first then rewrite to a LINQ version.

As svick points out, LINQ should be about making your program more readable. It is usually good at this as it tends to emphasize the intent of the code rather than the mechanism; however if you find you cannot make your queries more readable than a simple loop, feel free to stick with the loop.

If you need exercises to practice, most functional programming exercises will map nicely to LINQ e.g. 99 problems (especially the first 20 or so) or project euler.

2 added 417 characters in body
source | link

HonestlyLinq is primarily designed to allow pure functional queries and transformations on sequences of data (you will notice that all the LINQ operates take Func delegated but not Action delegates). Consequently the most common case of a loop that does not fit with linq well in one that is all about non pure functional side effects. e.g.

foreach(var x in list) Console.WriteLine(x);

To get better as using linq honestly, just practice using it.

Every time you are about to write a for or foreach loop to do something with a collection stop, consider if its a good fit for Linq (i.e. its not just performing an action/side effect on the elements) and if so force your self to write it using linq.

You could also write the foreach version first then rewrite to a linq version.

As svick points out linq should be about making you program more readable. It is usually good at this as it tends to emphasis the intension of the code rather than the mechanism, however if you find you cannot make your queries more readable than a simple loop feel free to stick with the loop.

If you need exercises to practice then most functional programming list exercise will map nicely to linq e.g. 99 problems (especially the first 20 or so) or project euler

Honestly, just practice using it.

Every time you are about to write a for or foreach loop to do something with a collection stop, consider if its a good fit for Linq (i.e. its not just performing an action/side effect on the elements) and if so force your self to write it using linq.

You could also write the foreach version first then rewrite to a linq version.

If you need exercises to practice then most functional programming list exercise will map nicely to linq e.g. 99 problems (especially the first 20 or so) or project euler

Linq is primarily designed to allow pure functional queries and transformations on sequences of data (you will notice that all the LINQ operates take Func delegated but not Action delegates). Consequently the most common case of a loop that does not fit with linq well in one that is all about non pure functional side effects. e.g.

foreach(var x in list) Console.WriteLine(x);

To get better as using linq honestly, just practice using it.

Every time you are about to write a for or foreach loop to do something with a collection stop, consider if its a good fit for Linq (i.e. its not just performing an action/side effect on the elements) and if so force your self to write it using linq.

You could also write the foreach version first then rewrite to a linq version.

As svick points out linq should be about making you program more readable. It is usually good at this as it tends to emphasis the intension of the code rather than the mechanism, however if you find you cannot make your queries more readable than a simple loop feel free to stick with the loop.

If you need exercises to practice then most functional programming list exercise will map nicely to linq e.g. 99 problems (especially the first 20 or so) or project euler

1
source | link

Honestly, just practice using it.

Every time you are about to write a for or foreach loop to do something with a collection stop, consider if its a good fit for Linq (i.e. its not just performing an action/side effect on the elements) and if so force your self to write it using linq.

You could also write the foreach version first then rewrite to a linq version.

If you need exercises to practice then most functional programming list exercise will map nicely to linq e.g. 99 problems (especially the first 20 or so) or project euler