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

  • Home
  • SEARCH
  • 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 3623392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:22:40+00:00 2026-05-18T23:22:40+00:00

Today I was thinking about declaring this: private delegate double ChangeListAction(string param1, int number);

  • 0

Today I was thinking about declaring this:

private delegate double ChangeListAction(string param1, int number);

but why not use this:

private Func<string, int, double> ChangeListAction;

or if ChangeListAction would have no return value I could use:

private Action<string,int> ChangeListAction;

so where is the advantage in declaring a delegate with the delegate keyword?

Is it because of .NET 1.1, and with .NET 2.0 came Action<T> and with .NET 3.5 came Func<T>?

  • 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-18T23:22:40+00:00Added an answer on May 18, 2026 at 11:22 pm

    The advantage is clarity. By giving the type an explicit name it is more clear to the reader what it does.

    It will also help you when you are writing the code. An error like this:

    cannot convert from Func<string, int, double> to Func<string, int, int, double>
    

    is less helpful than one which says:

    cannot convert from CreateListAction to UpdateListAction
    

    It also means that if you have two different delegates, both of which take the same types of parameters but conceptually do two entirely different things, the compiler can ensure that you can’t accidentally use one where you meant the other.

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

Sidebar

Related Questions

I'm thinking about trying out MVC later today for a new app we're starting
I just started thinking about creating/customizing a web crawler today, and know very little
I got to thinking about font (typeface) selection today. A site I did for
I was thinking earlier today about an idea for a small game and stumbled
I was thinking today about what could be the most complex / impressive application
Today I was thinking about a Python project I wrote about a year back
With twitter being down today I was thinking about how to best handle calls
I was thinking about CSS positioning modes today and realized that I never use
So I was playing around with Haskell today, thinking about autogeneration of function definitions
Today I started thinking about a new project, and I found one. The goal

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.