Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which of these two is the correct term: Named parameters or Named arguments?

Tags:

c#

With respect to C# 4.0, which of these two is the correct term: Named parameters or Named arguments? I find many occurences of both terms hence am quite confused how to mention them (say in formal documentation)?

like image 697
Mamta D Avatar asked Nov 10 '10 06:11

Mamta D


1 Answers

parameters have always been named; in the context of supplying values for a method, they are arguments - however, then name that you are specifying is the parameter name. So I can see how it would become mixed up ;p But in the context, we are supplying to name for the compiler to use to resolve the argument, so "named arguments" ftw.

More specifically:

7.5.1 Argument lists

An argument with an argument-name is referred to as a named argument, whereas an argument without an argument-name is a positional argument. It is an error for a positional argument to appear after a named argument in an argument-list.

like image 100
Marc Gravell Avatar answered Sep 18 '22 08:09

Marc Gravell