Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-26-2009, 06:31 PM   #1 (permalink)
 
Junior Techie

Join Date: Nov 2008

Posts: 79

BobLewiston is on a distinguished road

Default Why use delegates?

Why use delegates?

I understand HOW to use delegates, but in what situations would you actually use them? The examples I see in the literature are all in situations where the code could just be written without ever using them.
BobLewiston is offline  
Old 02-26-2009, 09:17 PM   #2 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default Re: Why use delegates?

Asynchronous operations need to use delegates. LINQ needs delegates. C# 3.0 allows for a more functional programming style (declarative as opposed to imperative), which requires delegates. Events are implemented as delegates. They are quite useful, but when you are first learning about them, it is not easy to see why. As you gain more experience, especially in an industry setting, it becomes much easier to see their importance and relevance.
jaeusm is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delegates and references to objects BobLewiston Programming Discussions 2 02-03-2009 08:01 AM