0

Assume, i have a method which parameters are classes with already defined documentation:

/// <summary>
///     Get criterion from table.
/// </summary>
/// <param name="plySide"></param>
/// <param name="criterionType"></param>
/// <returns></returns>
public Criterion GetCriterion(PlySide plySide, CriterionType criterionType)
{
   // some code
}

PlySide class has it's own xml-documentation:

/// <summary>
///     Sides of monoply.
/// </summary>
public enum PlySide
{
   // some code
}

As you can see in GetCriterion method i didn't define any doc for the plySide param tag. My question is should i duplicate description of a parameter or should i remove param tags?

1
  • I wouldn't consider it to be duplicated as the developer should always go back to the corresponding file to look at the comments if not Commented Jun 27, 2017 at 8:22

2 Answers 2

1

The PlySide documentation will describe what the type is.

The plySide documentation should describe what role that parameter plays within the GetCriterion method.

Those will usually be subtly (or not so subtly) different.

Sign up to request clarification or add additional context in comments.

Comments

1

You shouldn't duplicate it but give a context aware description of the parameter. In your case it could be something like this (perhaps it's toally wrong, but I don't know the implementation and intention of your method):

/// <summary>
///     Get criterion from table.
/// </summary>
/// <param name="plySide">Monopoly side to get criterion for</param>
/// <param name="criterionType">Criterion to get for the given monopoly side</param>
/// <returns></returns>
public Criterion GetCriterion(PlySide plySide, CriterionType criterionType)
{
   // some code
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.