C# Querying With LINQ Functional Programming in C# Delegates

Ruth O'Kelly
Ruth O'Kelly
4,944 Points

Still unclear why we use delegates.

This video didn't really explain why we would ever need to use delegates. It just gave an example of how to make one.

2 Answers

Michael Milone
Michael Milone
1,472 Points

Delegates are useful when you want to call a method and you want the caller to handle its implementation.

Steven Parker
Steven Parker
170,996 Points

Like many aspects of programming, you rarely need to use them. But they can be useful for solving certain kinds of problems. But more likely, you might want to use a library function that requires a delegate as an argument, so it's good to know how to construct one.

You'll probably see some examples for practical uses later on in your course.