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 3677292
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:12:14+00:00 2026-05-19T03:12:14+00:00

Since .net 4.0, is the new ettiquette to use syntax such as: Private Sub

  • 0

Since .net 4.0, is the new ettiquette to use syntax such as:

Private Sub Main()
    MyMethod(AddressOf AnAction)
End Sub

Private Sub MyMethod(ByVal toDo As Action(Of String, Integer, Boolean))
    toDo.Invoke("Tom", 1, True)
End Sub

Private Sub AnAction(ByVal p1 As String, ByVal p2 As Integer, ByVal p3 As Boolean)
End Sub

As opposed to:

Private Delegate Sub MyActionDlg(ByVal p1 As String, ByVal p2 As Integer, ByVal p3 As Boolean)

Private Sub Main()
    MyMethod(AddressOf AnAction)
End Sub

Private Sub MyMethod(ByVal toDo As MyActionDlg)
    toDo.Invoke("Tom", 1, True)
End Sub

Private Sub AnAction(ByVal p1 As String, ByVal p2 As Integer, ByVal p3 As Boolean)
End Sub

This goes the same with Tuples/Func too. It is nice to write but feels a bit sloppy in places. Why would anyone want Tuple(Of T, T2, T3, T4) over a nice class type? My actual piece of code has these nested, so it passes the Action along in a chain of methods.

Sorry for the VB example, AddressOf is just VBs way of saying new Action(AnAction). Also I just wrote this into the browser so it might not compile either.

How to people feel about reading and using these compiler generic actions as opposed to proper special entities crafted for their exact requirements in the solution?

  • 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-19T03:12:14+00:00Added an answer on May 19, 2026 at 3:12 am

    The new Func and Action delegates are preferred for simple delegates like the ones sed in LINQ methods.

    If using Funcs or Actions would result in unreadable typenames, you certainly should define your own delegates.

    In general, you should choose the design that results in the most readable code.

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

Sidebar

Related Questions

I haven't really looked into the new .NET stuff since 2.0, but I'm wondering
It's been a while since I've created a new ASP.NET web application. (I've been
I am new to C# .NET. I have been trying since 2 days, but
I am implementing a new ASP.NET MVC 3 application that will use a form
Since .NET arrays are covariant, the following works in C#: var strArray = new
I've been using Winforms since .NET 1.1 and I want to start learning WPF.
Since ASP.NET response filtering and post-cache substitution are not compatible, I need an alternative
Having not done ASP.NET since v1.1, and now blitzing through the Wrox Pro ASP.NET
I have been developing in asp.net since its existence (also classic asp before that)
LINQ is one of the greatest improvements to .NET since generics and it saves

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.