TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Rule:  5@120Checked automatically with code checker

Synopsis:Avoid using named arguments
Language:C#
Severity Level:4
Category:Object lifecycle


Description:

C# 4.0ís named arguments have been introduced to make it easier to call COM components that are known for offering tons of optional parameters. If you need named arguments to improve the readability of the call to a method, that method is probably doing too much and should be refactored.

The only exception where named arguments improve readability is when a constructor that yields a valid object is called like this:

Person person = new Person
(
    firstName: "John",
    lastName: "Smith",
    dateOfBirth: new DateTime(1970, 1, 1)
);



Literature References:
Aviva AV1555