Imperative Programming is what we're used to: we tell the computer *how* to do something. This usually involves giving step-by-step instructions such as looping through data, using "if" statements to make comparisons, and then doing the pieces of work that are important to our task.
Declarative Programming is a bit different: we tell the computer *what* we want done. Then we leave it up to the computer (or library) to figure out the rest. It turns out that we can use LINQ methods to make our code more declarative. And in doing this, we make our code easier to read and understand.
So be sure to check out Declarative Programming with LINQ:
This completes the basics of lambda expressions and LINQ. All of the videos are collected in this playlist:
Playlist: Lambda Expressions & LINQ in C#
- Part 1: Lambda Expression Basics
- Part 2: Demystifying LINQ Methods
- Part 3: Declarative Programming with LINQ