Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7006117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:26:11+00:00 2026-05-27T21:26:11+00:00

I would like to pose this question as long as I am trying currently

  • 0

I would like to pose this question as long as I am trying currently to dig into the use and the purpose of delegates, although it is likely to have been asked in similar formulations.

I know that delegates serve as function pointers used in C++. The matter of the fact is if in C# they serve mostly as an alternative to interfaces and polymorphism. Since I can create subclasses of a specific class and supply them the appropriate methods to each one, what offer delegates additionally to that? Are there cases that stipulate their use or is merely the maintainability of the code improved when delegates used? Would you recommend their wide deployment over interfaces?

I am speaking solely about delegates and I want to distinguish their role from the events role.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:26:11+00:00Added an answer on May 27, 2026 at 9:26 pm

    Yes, delegates are in many ways like single-method interfaces. However:

    • There is support built into the CLR for them
    • There’s support in the framework for them, including multi-cast abilities and asynchronous invocation
    • There’s additional C#/VB language support in the form of method group conversions, lambda expressions, anonymous methods
    • They’re mandated for events (i.e. events and delegates are a sort of matching pair)
    • They mean you don’t need to implement an interface in a separate class for each delegate instance you want to create.

    The last point is the most important one – consider a LINQ expression of:

    var query = collection.Where(x => x > 5)
                          .Select(x => x * x);
    

    Now imagine if to express the logic of x > 5 and x * x you had to write a separate class for each expression, and implement an interface: the amount of cruft vs useful code would be ridiculous. Now of course the language could have been designed to allow conversions from lambda expressions into interface implementations via separate classes, but then you’d still lose the benefit of being able to simply write a separate method and create a delegate with that as the target. You’d also still lose the multi-cast abilities.

    As a similar thought exercsise, consider looping statements such as while and for. Do we really need them when we’ve got goto? Nope. But life is much better with them. The same is true of delegates – and indeed properties, events, etc. They all make the development simpler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to pose this as a question to this answer but I
Would like to build the absolutepath use this information. Anyone knows how?
I would like to use a language that I am familiar with - Java,
I would like to do this in an NHibernate mapped object: private ShiftTradeOffer m_Offer;
The original question is here.. MySQL self-referencing ID and selects I would like to
Would like to use the return of: http://maps.google.de/maps/suggest?q=ham&cp=1&hl=de&gl=de&v=2&json=b as a JSON object in a
This one has me stumped and thought I would pose it to the SO
Thought I would pose this to the StackOverflow crowd since I've run out of
Would like to get a list of advantages and disadvantages of using Stored Procedures.
Would like to create a strong password in C++. Any suggestions? I assume it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.