By design, why is it necessary to specify parameter names when declaring a delegate type?

Why should we indicate the parameter name xas follows

public delegate void XXX(int x);

when declaring a delegate type?

For me, the parameter name is xnot used, so it will be easier if we can rewrite it as follows:

public delegate void XXX(int);

Please let me know why the C # developer "forced" to specify parameter names.

Edit1:

Is public delegate TResult Func<T1,TResult>(T1 arg1)more readable than public delegate TResult Func<T1,TResult>(T1)?

+5
source share
2 answers

Used by:

  • , intellisense , , , (, , , ) ()
  • - , ( ) tab, ( -)

, . , no idea, x , - , .

Action<int> .

+4

, , . , .

?

public delegate void EventHandler(object source, EventArgs e);

public delegate void EventHandler(object, EventArgs);
+2

All Articles